﻿(self.webpackChunkvk=self.webpackChunkvk||[]).push([[17592],{104022:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 16 16",d="videocam_16",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="videocam_16"><path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.75a2 2 0 00-2 2v4.5a2 2 0 002 2h5a2 2 0 002-2v-4.5a2 2 0 00-2-2H4zm11 2.2a.454.454 0 00-.103-.286c-.171-.21-.53-.19-.723-.095-.193.095-1.571.788-1.571.788a.233.233 0 00-.103.191v2.88c0 .075.038.145.103.19 0 0 1.097.548 1.571.789.434.22.826.033.826-.382V5.951z" fill="currentColor" /></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?16:+e.width,height:isNaN(e.height)?16:+e.height}))};v.mountIcon=h;const _=v},410902:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 24 24",d="error_circle_outline_24",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="error_circle_outline_24"><path d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm0 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm0 14a1.333 1.333 0 110 2.667A1.333 1.333 0 0112 16zm.324-10.667a1 1 0 011 1.037l-.266 7.276a1.059 1.059 0 01-2.116 0l-.265-7.276a1 1 0 01.963-1.036h.684z" fill="currentColor" /></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};v.mountIcon=h;const _=v},815653:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 24 24",d="menu_outline_24",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="menu_outline_24"><path d="M21 11H3a1 1 0 100 2h18a1 1 0 100-2zm0-7H3a1 1 0 000 2h18a1 1 0 100-2zM3 20h18a1 1 0 100-2H3a1 1 0 100 2z" fill="currentColor" /></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};v.mountIcon=h;const _=v},281536:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 24 24",d="more_horizontal_24",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="more_horizontal_24"><g fill="none" fill-rule="evenodd"><path d="M24 0H0v24h24z" /><path d="M18 10c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm-6 4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm-6 0c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" fill="currentColor" /></g></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};v.mountIcon=h;const _=v},521114:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 24 24",d="narrative_active_outline_24",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="narrative_active_outline_24"><path d="M14.298 1.435c.732.17 1.377.543 1.891 1.092.521.556.825 1.145 1.151 2.298l.79 2.944a1 1 0 11-1.931.518l-.72-2.69-.113-.401c-.215-.729-.377-1.024-.636-1.302a1.726 1.726 0 00-.887-.512c-.37-.086-.707-.078-1.445.1l-.405.104L6.866 4.96c-.854.228-1.254.394-1.51.583l-.06.047-.134.119c-.26.243-.43.539-.512.886-.093.4-.076.763.148 1.638l2.723 10.17.113.401c.215.729.377 1.024.636 1.302.244.26.54.43.887.512.401.093.745.076 1.607-.14a1 1 0 11.487 1.94c-1.148.288-1.805.32-2.549.147a3.726 3.726 0 01-1.891-1.092c-.521-.556-.825-1.145-1.151-2.298L2.922 8.963c-.355-1.324-.405-2.027-.22-2.823a3.722 3.722 0 01.93-1.728l.183-.182.179-.157c.496-.412 1.077-.685 2.091-.973l.263-.072 5.128-1.374c1.323-.355 2.026-.405 2.822-.22zM18.368 11c2 0 3.632 1.592 3.632 3.567 0 1.91-.772 2.851-3.78 5.134l-1.328 1.007c-.527.4-1.257.4-1.784 0l-1.328-1.007C10.772 17.418 10 16.476 10 14.567 10 12.592 11.631 11 13.632 11c.829 0 1.595.224 2.282.66l.086.057.086-.057a4.174 4.174 0 012.036-.653z" fill="currentColor" /></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};v.mountIcon=h;const _=v},662199:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 24 24",d="write_24",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="write_24"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><path d="M14.188 6.273l3.54 3.54-8.624 8.622a6.674 6.674 0 01-2.77 1.664l-2.903.886a.334.334 0 01-.416-.416l.886-2.902a6.674 6.674 0 011.664-2.771l8.623-8.623zm1.061-1.06l1.769-1.77a1.5 1.5 0 012.121 0l1.418 1.419a1.5 1.5 0 010 2.121L18.79 8.752l-3.54-3.54z" fill="currentColor" /></g></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};v.mountIcon=h;const _=v},587083:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 28 28",d="add_outline_28",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" id="add_outline_28"><g fill="none" fill-rule="evenodd"><path d="M0 0h28v28H0z" /><path d="M14 4a1 1 0 011 1v8h8a1 1 0 010 2h-8v8a1 1 0 01-2 0v-8H5a1 1 0 010-2h8V5a1 1 0 011-1z" fill="currentColor" fill-rule="nonzero" /></g></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?28:+e.width,height:isNaN(e.height)?28:+e.height}))};v.mountIcon=h;const _=v},488124:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var o=r(667294),i=r(887854),n=r.n(i),a=r(408091),s=r(634777),l=r(379333),c="0 0 36 36",d="add_36",u=!1;function h(){u||((0,s.addSpriteSymbol)(new(n())({id:d,viewBox:c,content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" id="add_36"><g fill="none" fill-rule="evenodd"><path d="M0 0h36v36H0z" /><path d="M19.5 19.5v9a1.5 1.5 0 01-3 0v-9h-9a1.5 1.5 0 010-3h9v-9a1.5 1.5 0 013 0v9h9a1.5 1.5 0 010 3h-9z" fill="currentColor" /></g></symbol>'})),u=!0)}var v=function(e){return(0,s.useIsomorphicLayoutEffect)((function(){h()}),[]),o.createElement(l.SvgIcon,(0,a.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?36:+e.width,height:isNaN(e.height)?36:+e.height}))};v.mountIcon=h;const _=v},47612:(e,t,r)=>{"use strict";r.r(t),r.d(t,{uiGetGallery:()=>n,UIGallery:()=>a});var o=r(469687),i=(0,o.makeSharedState)("ui-gallery",(()=>({galleries:{},incIndex:0})));function n(e){var t=domData(ge(e),"gallery-id");return t&&i().galleries[t]}class a{constructor(e,t){if(!e)throw new Error("No element was provided for UIGallery");if(e=ge(e),!hasClass(e,"ui_gallery"))throw new Error("Provided incorrect element for UIGallery");var r=n(e);if(r)return r;this._opts=extend({markOutside:!1,scrollY:!0,scrollX:!0,noArrows:!1},t),this._id=i().incIndex,i().incIndex+=1,this._el=e,this._width=getSize(this._el)[0],this._items=geByClass("ui_gallery_item",this._el),this._itemWidth=getSize(this._items[0])[0],this._itemOffset=intval(getStyle(this._items[0],vk.rtl?"marginLeft":"marginRight")),this._scrollOffset=intval(getStyle(this._items[0],"marginLeft")),this._itemFullWidth=this._itemWidth+this._itemOffset,this._innerCont=geByClass1("ui_gallery__inner_cont",this._el),this._inner=geByClass1("ui_gallery__inner",this._el),this._scroll=function(){var e={rtl:!1,backward:!1,delta:1,negative:!1,rtlSame:!1};if(!vk.rtl)return e;if(!cur._scrollInfo){var t=se('<div style="position: fixed; left: -1000; width: 0; overflow: scroll">x</div>');ge("content").appendChild(t);var r=t.scrollLeft;e.rtl=vk.rtl,e.backward=r>0,t.scrollLeft=1e3,e.delta=t.scrollLeft===r?-1:1,e.negative=!e.backward&&e.delta<0,e.rtlSame=e.rtl&&!e.backward&&!e.negative,re(t),cur._scrollInfo=e}return cur._scrollInfo}(),this._loadingMore=!1,this._finised=!1,this._visible={left:-1,right:-1,items:[]},this._outside={left:-1,right:-1,timer:null},this._initScroll(),this._initArrows(),domData(this._el,"gallery-id",this._id),i().galleries[this._id]=this,this._checkItemsAfterScroll(this._innerCont.scrollLeft,!0)}_initScroll(){(this._opts.scrollX||this._opts.scrollY)&&addEvent(this._innerCont,"DOMMouseScroll wheel",this._onWheelScroll.bind(this))}_initArrows(){this._opts.noArrows?addClass(this._el,"ui_gallery_no_arrows"):(this._leftArrow=geByClass1("ui_gallery__arrow_left",this._el),this._rightArrow=geByClass1("ui_gallery__arrow_right",this._el),this._arrowWidth=getSize(this._leftArrow)[0],addEvent(this._leftArrow,"click",this._onArrowScroll.bind(this,-1)),addEvent(this._leftArrow,"mouseover",this._onArrowMouseOver.bind(this,"left")),addEvent(this._leftArrow,"mouseout",this._onArrowMouseOut.bind(this)),addEvent(this._rightArrow,"click",this._onArrowScroll.bind(this,1)),addEvent(this._rightArrow,"mouseover",this._onArrowMouseOver.bind(this,"right")),addEvent(this._rightArrow,"mouseout",this._onArrowMouseOut.bind(this)))}_onWheelScroll(e){if(this._opts.scrollX||this._opts.scrollY){var t;if("wheel"==e.type)if(Math.abs(e.deltaY)>Math.abs(e.deltaX)){if(!this._opts.scrollY)return;t=-e.deltaY}else{if(!this._opts.scrollX)return;t=-e.deltaX}else if(void 0!==e.wheelDeltaY){if(!this._opts.scrollY)return;t=e.wheelDeltaY}else if(void 0!==e.wheelDelta)t=e.wheelDelta;else{if(!e.detail||1!==e.axis)return;t=-e.detail}t=this._scroll.rtlSame?-t:t,Math.abs(t)>=120&&(t=74*Math.max(-1,Math.min(1,t))),this._innerCont.scrollLeft-=t,this._checkItemsAfterScroll(this._innerCont.scrollLeft),cancelEvent(e)}}_onArrowScroll(e,t){if(!this._opts.noArrows){var r=this._innerCont.scrollLeft+(this._scroll.rtlSame?-e:e)*(this._width-2*this._arrowWidth),o=this._innerCont.scrollWidth-this._width;this._scroll.negative?(r=Math.min(r,0),r=Math.abs(r)):r=Math.max(0,r),r=Math.min(o,r);var i=this._scroll.negative||this._scroll.rtlSame?-e:e;if(i>0&&r<o)r=Math.floor(r/this._itemFullWidth)*this._itemFullWidth;else if(i<0&&r>0){r=Math.floor(r/this._itemFullWidth)*this._itemFullWidth}if(0===r||r===o){var n=this._innerCont.scrollWidth;addClass(this._inner,"ui_gallery__inner_shift_instant"),this._onArrowMouseOut(),r&&(r+=e*(this._innerCont.scrollWidth-n))}this._scroll.negative&&(r=-r),animate(this._innerCont,{scrollLeft:r},{duration:Math.abs(this._innerCont.scrollLeft-r)+50,transition:Fx.Transitions.easeOutCubic}),this._checkItemsAfterScroll(r),setTimeout((()=>removeClass(this._inner,"ui_gallery__inner_shift_instant")),0),cancelEvent(t)}}_checkItemsAfterScroll(e,t){if(this._scroll.negative&&(e=Math.abs(e)),this._opts.markOutside||this._opts.onViewItem){var r,o=this._itemWidth/3,i=(this._scroll.backward?this._inner.scrollWidth-this._width-e:e)-this._scrollOffset,n=e&&Math.floor(i/this._itemFullWidth),a=n*this._itemFullWidth+2*o;r=this._scroll.backward?e+this._width<this._inner.scrollWidth-a:e>a;var s,l=Math.min(this._items.length-1,Math.floor((i+this._width)/this._itemFullWidth)),c=l*this._itemFullWidth+2*o;if(s=this._scroll.backward?e>this._inner.scrollWidth-c:e+this._width<c,this._opts.onViewItem){var d=r?Math.min(this._items.length-1,n+1):n,u=s?Math.max(0,l-1):l;if(t||d!==this._visible.left||u!==this._visible.right){for(var h=d;h<=u;h++)(this._visible.left<0||t&&!inArray(this._items[h],this._visible.items)||h<this._visible.left||h>this._visible.right)&&this._opts.onViewItem(this._items[h],h);this._visible.left=d,this._visible.right=u,this._visible.items=this._items.slice(d,u+1)}}this._opts.markOutside&&(t?(geByClass("ui_gallery_item_outside",this._inner).forEach((e=>{removeClass(e,"ui_gallery_item_outside")})),this._outside.left=-1,this._outside.right=-1):((n!==this._outside.left||!r)&&this._outside.left>=0&&(removeClass(this._items[this._outside.left],"ui_gallery_item_outside"),this._outside.left=-1),(l!==this._outside.right||!s)&&this._outside.right>=0&&(removeClass(this._items[this._outside.right],"ui_gallery_item_outside"),this._outside.right=-1)),r&&n!==this._outside.left&&(addClass(this._items[n],"ui_gallery_item_outside"),this._outside.left=n),s&&l!==this._outside.right&&(addClass(this._items[l],"ui_gallery_item_outside"),this._outside.right=l))}if(!this._opts.noArrows){var v=e>0,_=e+this._width<this._inner.scrollWidth;toggleClass(this._leftArrow,"ui_gallery__arrow_visible",this._scroll.rtl&&!this._scroll.backward?_:v),toggleClass(this._rightArrow,"ui_gallery__arrow_visible",this._scroll.rtl&&!this._scroll.backward?v:_)}(!this._scroll.backward&&this._inner.scrollWidth-e-this._width<1e3||this._scroll.backward&&e<1e3)&&this._onLoadMore()}_onArrowMouseOver(e){this._opts.noArrows||addClass(this._inner,"ui_gallery__inner_shift_"+e)}_onArrowMouseOut(){this._opts.noArrows||(removeClass(this._inner,"ui_gallery__inner_shift_left"),removeClass(this._inner,"ui_gallery__inner_shift_right"))}_onLoadMore(){!this._opts.onLoadMore||this._loadingMore||this._finised||(this._loadingMore=!0,this._opts.onLoadMore(this._items.length))}addMore(e,t){e=e||[],this.addItems(e),this._finised=!!t||!e.length,this._loadingMore=!1}addItems(e,t){if((e=e||[]).length){var r=t>=0&&t<this._items.length?this._items[t]:null;e.forEach((e=>{r?domInsertBefore(e,r):this._inner.appendChild(e)})),this.refresh()}}destroy(){removeEvent(this._innerCont),removeEvent(this._leftArrow),removeEvent(this._rightArrow),domData(this._el,"gallery-id",null),delete i().galleries[this._id],this._opts.onDestroy&&this._opts.onDestroy(),re(this._el)}removeItem(e){return isNumeric(e)&&(e=this._items[e]),!(!e||!inArray(e,this._items))&&(re(e),this.refresh(),this._items.length||this.destroy(),!0)}refresh(){this._width=getSize(this._el)[0],this._items=geByClass("ui_gallery_item",this._el),this._checkItemsAfterScroll(this._innerCont.scrollLeft,!0)}getItems(){return this._items}getVisibleItems(){return this._visible.items.map(((e,t)=>[e,this._visible.left+t]))}}},387142:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var o=r(803834),i=r(982452),n=r(315544),a=r(695724),s=r(49535);function l(e,t,r){if((0,a.isObject)(t)?r=t:this._dragElClass=t,this.options=(0,a.extend)({dragThreshold:l.DRAG_THRESHOLD_DIST},r),this._contEl=(0,n.ge)(e),this._contEl){this._excludedCount=0;for(var o=0;o<this._contEl.children.length;o++)this._contEl.children[o].getAttribute("nodrag")&&this._excludedCount++;(0,s.addEvent)(this._contEl,"mousedown",this._ev_mousedown_handler=this._onMouseDown.bind(this)),(0,n.setStyle)(this._contEl,"position","relative"),this._inited=!0,this._updateScrollbar=this._initUpdaterScrollbar()}}l.AUTO_SCROLL_DY=10,l.DRAG_THRESHOLD_DIST=0,l.AUTO_SCROLL_DISTANCE_THRESHOLD=300,l.AUTO_SCROLL_GAP=300,l.prototype.destroy=function(){this._inited&&(this._inited=!1,this._deinitEvents(!0))},l.prototype._getParentDragItemEl=function(e){for(var t,r=e;r&&(t=(0,n.domPN)(r))!==this._contEl;)r=t;return r===this._curPlaceholderEl&&(r=null),r},l.prototype._onKey=function(e){e.keyCode===s.KEY.ESC&&this.isCurrentlyDragging()&&this._onMouseUp()},l.prototype._onMouseDown=function(e){if(!(this._disabled||0!=e.button||this._curDragEl||(0,n.attr)(e.target,"nodrag")||this._dragElClass&&!(0,n.domClosest)(this._dragElClass,e.target))){for(var t=e.target;t&&t!==window.document;){if((0,a.intval)((0,n.domData)(t,"nodrag")))return;t=(0,n.domPN)(t)}var r=this._getParentDragItemEl(e.target);if(r&&!(0,n.attr)(r,"nodrag")&&((0,n.re)((0,n.geByClass1)("ui_gridsorter_placeholder"),this._contEl),this._contInfo=this._contInfo||{prevSize:(0,n.getSize)(this._contEl)},this._ensureGridIsActual(),!(this._grid.length<=1))){var o=window.getComputedStyle(r),i=(0,n.getXY)(r);this._initial={candidateEl:r,x:e.clientX,y:e.clientY,itemMargin:{x:parseInt(o.marginLeft),y:parseInt(o.marginTop)},shift:{x:e.pageX-i[0],y:e.pageY-i[1]}},(0,s.addEvent)(document,"mousemove",this._ev_mousemove_handler=this._onMouseMove.bind(this)),(0,s.addEvent)(document,"mouseup",this._ev_mouseup_handler=this._onMouseUp.bind(this)),(0,s.addEvent)(document,"keydown",this._ev_keydown_handler=this._onKey.bind(this)),cur.cancelClick=!1,(0,s.cancelEvent)(e)}}},l.prototype._dist=function(e){return Math.abs(e.clientX-this._initial.x)+Math.abs(e.clientY-this._initial.y)},l.prototype._onMouseUp=function(e){var t=this._curDragEl,r=!e;if(this._curDragEl){this._curDragEl=null,(0,n.removeClass)(t,"ui_gridsorter_moveable_notrans"),this._curOverCell||(this._curOverCell={el:this._curPlaceholderEl,pos:(0,n.getXY)(this._curPlaceholderEl),size:(0,n.getSize)(this._curPlaceholderEl)});var o=this._curOverCell.pos,i=this._curOverCell.el,a=this._grid[this._curDragCellIndex],l=a&&a.size;(0,n.gpeByClass)("_ape_item_list",t)&&(o[0]+=20,o[1]+=20),l&&this._isShiftToLeft&&(o[1]-=l[1]-this._curOverCell.size[1]),setTimeout((()=>{if(r){for(var e=0,i=this._grid.length;e<i;e++){var n=this._grid[e];n.dirty&&this._setPos(n.el,{left:0,top:0})}this._setPos(t,this._initialCurDragPos)}else this._setPos(t,{left:o[0],top:o[1]})})),setTimeout((()=>{if((0,n.re)(this._curPlaceholderEl),(0,n.removeClass)(this._contEl,"ui_gridsorter_cont"),this.options.dragCls&&(0,n.removeClass)(t,this.options.dragCls),this._inited){var e;if(r){for(var o=this._grid.length,a=0;a<o;a++){var s=this._grid[a];s.dirty&&this._setPos(s.el,{left:null,top:null})}this._setPos(t,{left:null,top:null,width:null,height:null})}else{var l;e=this._isShiftToLeft?(0,n.domNS)(i):i,this._contEl.insertBefore(t,e);var c=-1,d=this._initial.hasInlineSize;this._setPos(t,{left:null,top:null}),d||(0,n.setStyle)(t,{width:null,height:null});for(var u=this._grid.length,h=0;h<u;h++){var v=this._grid[h];(v.dirty||v.el===t)&&(this._setPos(v.el,{left:null,top:null}),d||(0,n.setStyle)(v.el,{width:null,height:null}),v.pos=this._calcElementPos(v.el),v.dirty=!1),v.el===t?l=h:v.el===i&&(c=h)}if(c>=0){var _=this._grid.splice(l,1);this._grid.splice(c,0,_[0])}}(0,n.removeClass)(t,"ui_gridsorter_moveable"),this._curOverCell=this._curPlaceholderEl=null,r&&this.update(),this.options.onDragFinish&&this.options.onDragFinish(t),i!==t&&!r&&this.options.onReorder&&this.options.onReorder(t,e,(0,n.domPS)(t))}}),210),e&&this._dist(e)>5&&((0,s.cancelEvent)(e),cur.cancelClick=!0)}this._updateScrollbar(),this._deinitEvents(),t&&this._overEl&&this.options.onDragLeave&&this.options.onDragLeave(this._overEl,t),r||t&&this._overEl&&this.options.onDragDrop&&(r=this.options.onDragDrop(this._overEl,t)),this._overEl=null},l.prototype._deinitEvents=function(e){e&&(this._onMouseUp(),(0,s.removeEvent)(this._contEl,"mousedown",this._ev_mousedown_handler)),clearTimeout(this._autoScrollTO),this._autoScrollTO=!1,this._ev_mousemove_handler&&(0,s.removeEvent)(document,"mousemove",this._ev_mousemove_handler),this._ev_mouseup_handler&&(0,s.removeEvent)(document,"mouseup",this._ev_mouseup_handler),this._ev_keydown_handler&&(0,s.removeEvent)(document,"keydown",this._ev_keydown_handler)},l.prototype._setPos=function(e,t){this.options.noPosTransform||!this._hasTranslateFeauture&&!(this._hasTranslateFeauture=window.getComputedStyle(e).getPropertyValue("transform"))?(0,n.setStyle)(e,(0,a.extend)({transform:null},t)):null===t.left||null===t.top?(0,n.setStyle)(e,{transform:null,top:null,left:null}):(0,n.setStyle)(e,{transform:"translate("+t.left+"px, "+t.top+"px)",top:null,pos:null})},l.prototype._recalc=function(){var e=this._curDragEl,t=this._curOverCell.el;if(this._initGrid(),t!==e){for(var r=0,o=!1,i=!1,n=this._grid.length,a=0;a<n;a++){var s=this._grid[a];if(s.el===e){o=!0;break}if(s.el===t){o=!1;break}}this._isShiftToLeft=o;for(var l=o?0:this._grid.length-1,c=o?this._grid.length:-1,d=o?1:-1,u=[0,0];l!==c;l+=d){var h=this._grid[l];if(2!==r)if(h.el!==e){if(h.el===t&&r++,1===r||2===r){var v=0,_=0;o?(v=i.pos[0]+u[0],_=i.pos[1]+u[1],u[0]+=h.size[0]-i.size[0],u[1]+=h.size[1]-i.size[1]):(u[0]+=i.size[0]-h.size[0],u[1]+=i.size[1]-h.size[1],v=i.pos[0]+u[0],_=i.pos[1]+u[1]),this._setPos(h.el,{left:v-h.pos[0],top:_-h.pos[1]}),h.dirty=!0}else h.dirty&&(this._setPos(h.el,{left:null,top:null}),h.dirty=!1);i=h}else r++,i=h;else h.dirty&&(this._setPos(h.el,{left:null,top:null}),h.dirty=!1),i=h}}else for(var p=this._grid.length,g=0;g<p;g++){var m=this._grid[g];m.el!==e&&m.dirty&&(m.dirty=!1,this._setPos(m.el,{left:null,top:null}))}},l.prototype.disable=function(){this._disabled=!0},l.prototype.enable=function(){this._disabled=!1,this._initGrid(!0)},l.prototype.update=function(){this._disabled||this._initGrid(!0)},l.prototype._ensureGridIsActual=function(){this._initGrid()},l.prototype._needGridUpdate=function(){if(!this._grid)return 1;this._contInfo.prevSize=this._contInfo.prevSize||(0,n.getSize)(this._contEl);var e=0,t=this._contEl.children.length-this._excludedCount-(0,a.intval)(!!this._curPlaceholderEl);if(t!==this._grid.length)e=t>this._grid.length?2:1,this._contInfo.prevSize=(0,n.getSize)(this._contEl);else{var r=(0,n.getSize)(this._contEl),o=this._contInfo.prevSize;(Math.abs(o[0]-r[0])>5||Math.abs(o[1]-r[1])>5)&&(e=1),this._contInfo.prevSize=r}return e},l.prototype._initGrid=function(e){var t=e?1:this._needGridUpdate();if(t){1===t&&(this._grid=[],this._contInfo&&(delete this._contInfo.pos,delete this._contInfo.size));var r=this._grid?this._grid[this._grid.length-1]:null;this._grid=this._grid||[];var o,i=!!r,a=this._contEl.children;if(a.length)for(var s=this._getItemMargins(),l=this._curDragEl?this._grid.length:0,c=a.length;l<c;l++){var d=a[l];r&&d===r.el?i=!1:i||d===this._curPlaceholderEl||d.getAttribute("nodrag")||((o=(0,n.getSize)(d))[0]+=s[0],o[1]+=s[1],this._grid.push({el:d,size:o,pos:this._calcElementPos(d)}))}}},l.prototype._getRelativeMousePos=function(e){var t=this._getContPos(),r=this._getContShift();return{left:e.clientX-t[0]-r[0],top:e.clientY-t[1]-r[1]}},l.prototype._updateDraggablePosition=function(e){if(this._curDragEl){var t=this._getRelativeMousePos(e),r=this._getItemShift(),o=this._getContShift(),i=this._getContSize(),a=t.top-this._initial.shift.y-r[1]+o[1];this.options.limitBottomMove&&(a=Math.min(a,i[1]+30)),(0,n.hasClass)(this._contEl,"_ape_item_list")&&(a+=this._contEl.scrollTop),this._setPos(this._curDragEl,{left:t.left-this._initial.shift.x-r[0]+o[0],top:a}),window.AudioPage&&window.AudioPage.onUpdateDraggablePosition&&window.AudioPage.onUpdateDraggablePosition()}},l.prototype._getContShift=function(){if(this._contInfo=this._contInfo||{},!this._contInfo.shift){var e=window.getComputedStyle(this._contEl);this._contInfo.shift=[parseFloat(e.paddingLeft),parseFloat(e.paddingTop)]}return this._contInfo.shift},l.prototype._getContSize=function(){return this._contInfo=this._contInfo||{},this._contInfo.size=(0,n.getSize)(this._contEl),this._contInfo.size},l.prototype._getContPos=function(){return this._contInfo=this._contInfo||{},this._contInfo.pos=(0,n.getXY)(this._contEl),this._contInfo.pos[1]-=(0,o.scrollGetY)(),this._contInfo.pos},l.prototype._getItemShift=function(){if(this._contInfo=this._contInfo||{},!this._contInfo.itemShift){var e=window.getComputedStyle((0,n.domFC)(this._contEl));this._contInfo.itemShift=[parseFloat(e.marginLeft),parseFloat(e.marginTop)]}return this._contInfo.itemShift},l.prototype._getItemMargins=function(){if(this._contInfo=this._contInfo||{},!this._contInfo.itemMargins){var e=window.getComputedStyle((0,n.domFC)(this._contEl));this._contInfo.itemMargins=[parseFloat(e.marginLeft)+parseFloat(e.marginRight),parseFloat(e.marginTop)+parseFloat(e.marginBottom)]}return this._contInfo.itemMargins},l.prototype._calcElementPos=function(e){var t=this._getContShift(),r=this._getItemShift();return[e.offsetLeft-t[0]-r[0],e.offsetTop-t[1]-r[1]]},l.prototype.isCurrentlyDragging=function(){return!!this._curDragEl},l.prototype._initUpdaterScrollbar=function(){return(0,i.throttle)((e=>{var t=this.options.wrapNode||e,r=(0,n.data)(t,"sb");r&&r.update(!1,!0)}),500)},l.prototype._onMouseMove=function(e){var t=()=>this.options.wrapNode?this.options.wrapNode.scrollTop:(0,o.scrollGetY)(),r=e=>{this.options.wrapNode?this.options.wrapNode.scrollTop=e:(0,o.scrollToY)(e,0,!1,!0)};if(this._curDragEl){this._ensureGridIsActual(),!e&&(e={clientX:this._lastMousePos.x,clientY:this._lastMousePos.y}),this._lastMousePos={x:e.clientX,y:e.clientY},this._updateDraggablePosition(e);var i=this._getContSize(),a=this._getRelativeMousePos(e),l=!1;if((0,n.hasClass)(this._contEl,"_ape_item_list")&&(a.top+=this._contEl.scrollTop),a.left>0&&a.left<i[0]&&a.top>0&&a.top<i[1])for(var c=0,d=this._grid.length-1,u=50;u;){var h=c+Math.floor((d-c)/2),v=this._grid[h];if(a.left>v.pos[0]&&a.top>v.pos[1]&&a.left<v.pos[0]+v.size[0]&&a.top<v.pos[1]+v.size[1]){l=v;break}if(c===d)break;a.top<v.pos[1]||a.left<v.pos[0]&&a.top<v.pos[1]+v.size[1]?d=d===h?d-1:h:c=c===h?c+1:h,u--}else{for(var _,p,g,m=this._grid.length,f=999999,w=0;w<m;w++){var y=this._grid[w],E=(p=a.left-(y.pos[0]+y.size[0]/2))*p+(g=a.top-(y.pos[1]+y.size[1]/2))*g;f>E&&(f=E,_=y)}l=_}!l||this._curOverCell&&this._curOverCell.el===l.el||(this._curOverCell=l,this._recalc());var S,C,N,b,k=0;if(this.options.wrapNode)S=b=this.options.wrapNode,C=(0,n.getSize)(S),(N=(0,n.getXY)(S))[1]-=(0,o.scrollGetY)(),k=e.clientY;else{var I=window,L=document.documentElement,T=document.getElementsByTagName("body")[0],B=I.innerWidth||L.clientWidth||T.clientWidth,x=I.innerHeight||L.clientHeight||T.clientHeight;b=I.bodyNode,C=[B,x],N=[0,0],k=e.clientY}var A=Math.max(20,C[1]/10),D=N[1]+A-k,P=A-(N[1]+C[1]-k);if(P>0||D>0){var R=Math.min(1,D/A),O=Math.min(1,P/A);this._autoScrollTO||(this._autoScrollTO=setTimeout((()=>{this._autoScrollTO=!1;var e=t();r(e+16*(R>0?-R:O)),e!==b.scrollTop&&(this._updateScrollbar(b),this._onMouseMove())}),20))}if(this.options.onDragOverElClass){var M=e.target;(0,n.hasClass)(M,this.options.onDragOverElClass)||(M=(0,n.gpeByClass)(this.options.onDragOverElClass,M))?this._overEl!==M&&(this._overEl&&this.options.onDragLeave&&this.options.onDragLeave(this._overEl,this._curDragEl),this.options.onDragEnter&&this.options.onDragEnter(M,this._curDragEl),this._overEl=M):(this._overEl&&this.options.onDragLeave&&this.options.onDragLeave(this._overEl,this._curDragEl),this._overEl=null)}}else if(this._dist(e)>this.options.dragThreshold){this._curDragEl=this._initial.candidateEl;for(var U=this._grid.length,H=0;H<U;H++)if(this._grid[H].el===this._curDragEl){this._curDragCellIndex=H;break}this.options.dragCls&&(0,n.addClass)(this._curDragEl,this.options.dragCls);var F=(0,n.getSize)(this._curDragEl),G=(0,n.getXY)(this._curDragEl),W=window.getComputedStyle(this._curDragEl),V=this._getContPos();this._initial.hasInlineSize=!(!this._curDragEl.style.width&&!this._curDragEl.style.height),(0,n.setStyle)(this._curDragEl,{width:F[0],height:F[1]}),this._initialCurDragPos={left:G[0]-V[0],top:G[1]-V[1]-bodyNode.scrollTop},this._curPlaceholderEl=(0,n.ce)("div",{className:"ui_gridsorter_placeholder"}),(0,n.setStyle)(this._curPlaceholderEl,{width:F[0]+parseFloat(W.marginLeft)+parseFloat(W.marginRight),height:F[1]+parseFloat(W.marginTop)+parseFloat(W.marginBottom)}),this._contEl.insertBefore(this._curPlaceholderEl,this._curDragEl),(0,n.addClass)(this._curDragEl,"ui_gridsorter_moveable"),(0,n.addClass)(this._curDragEl,"ui_gridsorter_moveable_notrans"),(0,n.addClass)(this._contEl,"ui_gridsorter_cont"),this._onMouseMove(e),this._updateDraggablePosition(e),this.options.onDragStart&&this.options.onDragStart(this._curDragEl)}(0,s.cancelEvent)(e)};const c=l},601261:(e,t,r)=>{"use strict";r.d(t,{ON_BOARDING_BG_RECT_ID:()=>l,default:()=>u});r(530522),r(66108),r(296253),r(991181),r(579665),r(95767);var o=r(315544),i=r(803834),n=r(696547);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],o=!0,i=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw n}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var l="onboarding_bg_rect",c="page_header_cont",d="onboarding";class u{constructor(e,t){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.el=e,this.text=t,this.hideDarkness=!0,this.oldColor=!1;var i,n,a={autoShow:!1,noAutoHideOnWindowClick:null===(r=o.noAutoHideOnWindowClick)||void 0===r||r,content:t instanceof HTMLElement?t:`${t}`,cls:`feature_intro_tt tutorial_tip_tt ${n=null!==(i=o.class)&&void 0!==i?i:"",o.tooltipWhite?n:n+" feature_intro_blue_tt"}`,appendToParent:!0,onHide:this.ttOnHide.bind(this),scrollOffset:o.scrollOffset||0,align:o.align||window.ElementTooltip.ALIGN_CENTER};o.side&&(a.forceSide=o.side),o.offset&&(a.offset=o.offset),o.width&&(a.width=o.width),o.shift&&(a.centerShift=o.shift),o.border?this.border=o.border:this.border=[10,10,10,10],o.ttOnHide&&(a.onHide=o.ttOnHide),o.withCloseButton&&(a.withCloseButton=o.withCloseButton,a.onCloseButtonClick=o.onCloseButtonClick),o.align&&(a.align=o.align),this.ttParams=a,this.opts=o,this.initOnboardingBG()}initOnboardingBG(){if(!window.onboardingBG){var e=se('\n<div id="onboarding_layout">\n  <svg id="onboarding_bg_header" width="100%" height="49px">\n    <rect id="onboarding_bg_rect" class="GroupOnboardingBg" x="0" y="0" width="100%" height="100%" fill-opacity="0.8" fill="#000"></rect>\n  </svg>\n  <svg id="onboarding_bg" width="100%" height="100%">\n  <defs>\n    <mask id="mask" x="0" y="0" width="100%" height="100%">\n      <rect x="0" y="0" width="100%" height="100%" fill="#fff"></rect>\n      <rect id="onboarding_bg_clip" class="GroupOnboardingBgClip" x="0" y="0" width="0" height="0" fill="#000" rx="8" ry="8"></rect>\n    </mask>\n  </defs>\n  <rect id="onboarding_bg_rect" class="GroupOnboardingBg" x="0" y="42" width="100%" height="100%" mask="url(#mask)" fill-opacity="0.8"></rect>\n  </svg>\n</div>\n      ');(0,o.domInsertBefore)(e,window.layerBG),window.onboardingBGHeader=ge("onboarding_bg_header"),window.onboardingBG=ge("onboarding_bg"),window.onboardingBGRect=ge(l),window.onboardingBGClip=ge("onboarding_bg_clip"),window.cur.destroy.push((()=>{hide(window.onboardingBG),hide(window.onboardingBGHeader),removeClass(ge(c),d),this.hideDarkness=!0,this.hideTT(),delete window.onboardingBG,delete window.onboardingBGHeader,delete window.onboardingBGRect,delete window.onboardingBGClip,this.opts.onBGClick&&removeEvent(window.onboardingBG,"click",this.opts.onBGClick)})),this.opts.onBGClick&&addEvent(window.onboardingBG,"click",this.opts.onBGClick)}}showTT(){var e=a((0,o.getXY)(this.el),2)[1];this.tt=new window.ElementTooltip(this.el,this.ttParams),this.opts.highlight&&(this.addDarkness(),this.addHighlight()),this.tt.show();var t=this.tt.getContent();(0,n.isElementInViewport)(this.el)&&(0,n.isElementInViewport)(t)||(0,i.scrollToY)(e-42-this.ttParams.scrollOffset)}hideTT(){this.tt&&(this.opts.onHide&&this.opts.onHide(),this.tt.destroy(),this.removeDarkens(),this.hideDarkness&&(removeEvent(window,"scroll"),removeEvent(window,"resize")))}addHighlight(){window.onboardingBGClip&&(this.highlightElement(),addEvent(window,"scroll",this.onScrollTT.bind(this)),addEvent(window,"resize",this.onResizeTT.bind(this)))}highlightElement(){var e=this.el.offsetWidth,t=this.el.offsetHeight,r=(0,o.getXY)(this.el);attr(window.onboardingBGClip,"width",e+this.border[1]+this.border[3]),attr(window.onboardingBGClip,"height",t+this.border[0]+this.border[2]),attr(window.onboardingBGClip,"x",r[0]-this.border[1]),attr(window.onboardingBGClip,"y",r[1]-this.border[0])}onResizeTT(){this.setDartToFullWidth(),this.highlightElement()}onScrollTT(){var e=this.getPageHeight();window.onboardingBG.height!=e&&this.setDartToFullHeight()}setDartToFullHeight(){attr(window.onboardingBG,"height",this.getPageHeight())}setDartToFullWidth(){attr(window.onboardingBG,"width",this.getPageWidth()),attr(window.onboardingBGHeader,"width",this.getPageWidth())}addDarkness(){(0,o.isVisible)(window.onboardingBG)||(this.setDartToFullHeight(),this.setDartToFullWidth(),show(window.onboardingBG),(0,o.isVisible)(window.onboardingBGHeader)||(show(window.onboardingBGHeader),addClass(ge(c),d)))}removeDarkens(){this.hideDarkness&&(hide(window.onboardingBG),hide(window.onboardingBGHeader),removeClass(ge(c),d))}ttOnHide(){this.hideTT()}show(){setTimeout(this.showTT.bind(this),1e3)}getPageWidth(){var e=document.documentElement,t=document.body;return Math.max(t.scrollWidth,e.scrollWidth,t.offsetWidth,e.offsetWidth,t.clientWidth,e.clientWidth)}getPageHeight(){var e=document.documentElement,t=document.body;return Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,t.clientHeight,e.clientHeight)}}},696547:(e,t,r)=>{"use strict";function o(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}r.d(t,{isElementInViewport:()=>o})},980309:(e,t,r)=>{"use strict";r.d(t,{getNativeOption:()=>i,createScroll:()=>l});var o=r(610124);function i(e,t){return bodyNode[e]||document.documentElement[e]}class n{constructor(e,t){this.el=e,this.opts=t,this.module=(0,o.createModule)({handlers:(e,t)=>{e(window,"scroll",this.onScroll.bind(this)),e(window,"resize",this.resize.bind(this))}}),this.innerHeight=window.innerHeight,this.prevScroll=this.scrollTop()}update(){}resize(){this.innerHeight=window.innerHeight}scrollTop(e){if(void 0===e)return i("scrollTop",this.el);!function(e,t,r){"scrollTop"===e&&window.scrollTo(0,t)}("scrollTop",e,this.el)}contHeight(){return i("scrollHeight")}smoothScroll(e){scrollToY(e+this.scrollTop(),300)}getContainer(){return this.el}getScroller(){return null}scrollBottom(e){if(void 0===e)return this.contHeight()-this.scrollTop()-this.getScrollHeight();var t=this.contHeight()-e-this.getScrollHeight();this.scrollTop(t)}scrollBottomFixSave(e){var t=Date.now(),r=()=>{Date.now()-t<500&&this.scrollBottom(e),window.removeEventListener("scroll",r)};window.addEventListener("scroll",r),this.scrollBottom(e)}onScroll(e){var t=this.scrollTop(),r=t-this.prevScroll,o=this.contHeight();this.opts.onScroll&&this.opts.onScroll(-r,this),this.opts.scrollChange&&this.opts.scrollChange(t),this.opts.more&&o-t<2*this.innerHeight&&this.opts.more(this),this.prevScroll=t}getScrollHeight(){return this.innerHeight}destroy(){(0,o.destroyModule)(this.module)}}class a{constructor(e,t){this.prevTop=0,this.scroll=new uiScroll(e,{hidden:void 0===t.hidden||t.hidden,shadows:t.shadows,stopScrollPropagation:!1,theme:t.scrollTheme,onmore:()=>t.more&&t.more(this),onscroll:e=>{var r=this.scrollTop(),o=this.prevTop-r;this.prevTop=r,t.scrollChange&&t.scrollChange(r),t.onScroll&&t.onScroll(o,this)}})}update(){this.scroll.update("sync")}scrollTop(e){return void 0!==e?this.scroll.scrollTop(e):this.scroll.data.scrollTop}getContainer(){return this.scroll.content}getScroller(){return this.scroll.scroller}contHeight(){return this.scroll.data.scrollHeight}smoothScroll(e){this.scroll.scrollTop(this.scrollTop()+e,300)}scrollBottom(e){return void 0!==e?this.scroll.scrollBottom(e):this.scroll.data.scrollBottom}scrollBottomFixSave(e){var t=Date.now();this.scroll.emitter.addOnceListener("resize",(()=>{Date.now()-t<500&&this.scroll&&this.scrollBottom(e)})),this.scrollBottom(e)}getScrollHeight(){return this.scroll.data.viewportHeight}destroy(){this.scroll.destroy()}}class s{constructor(e,t){this.el=e}update(){}getContainer(){return this.el}getScroller(){return null}scrollTop(e){return 0}contHeight(){return 0}smoothScroll(e){}scrollBottom(e){return 0}scrollBottomFixSave(e){}getScrollHeight(){return 0}destroy(){}}function l(e,t){return t.noScroll?new s(e):t.nativeScroll?new n(e,t):new a(e,t)}},418793:(e,t,r)=>{"use strict";r.d(t,{Scroll:()=>s});r(95767),r(991181),r(296253);var o=r(667294),i=r(32821),n=r(980309);r(45697);function a(e,t){if(null==e)return{};var r,o,i=function(e,t){if(null==e)return{};var r,o,i={},n=Object.keys(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=e=>{var t=e.children,r=a(e,["children"]);return o.createElement(i.ScrollContext.Provider,{value:{createScroll:n.createScroll}},o.createElement(i.Scroll,r,t))};s.defaultProps={isNative:!1,isShadows:!1,neverHide:!1,onScroll:null}},542041:(e,t,r)=>{"use strict";r.d(t,{Likes:()=>y});r(991181),r(296253),r(796409),r(59357),r(175115),r(21466);var o=r(315544),i=r(49535),n=r(376852),a=r(695724),s=r(635676),l=r(850167),c=r(40906),d=r(654612),u=r(786067),h=r(465864),v=r(325698),_=r(95146),p=r(908706),g=r(107337),m=r(576772),f=r(210277);function w(){return w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},w.apply(this,arguments)}var y={toggle(e,t,r,n){if((0,i.cancelEvent)(t),(0,c.isObject)(window.cur)&&(0,c.isFunction)(cur.viewAsBox))return cur.viewAsBox();if(vk.widget&&!vk.id)return window.Widgets.oauth();var a=(0,o.hasClass)(e,"active");(0,o.addClass)(e,"animate"),this.clientUpdate(r,v.LikeButtonTypes.like,a?-1:1,!a);var s=()=>{(0,o.toggleClass)(e,"active",a),this.clientUpdate(r,v.LikeButtonTypes.like,a?1:-1,a)};window.ajax.post("like.php",{act:a?"a_do_unlike":"a_do_like",object:r,hash:n,list:cur.pvListId,wall:2,from:this._getReference(r),from_widget:vk.widget?1:0},{onDone:t=>{if(t.unauth_action_box)return s(),void m.UnauthActionBox.show(t.unauth_action_box);this.update(r,t);var o=r.match(/^(wall|market)(.*)/);o&&cur.onLike&&cur.onLike(e,o[1],o[2],a)},onFail:()=>(s(),!1)}),(0,c.intval)((0,o.domData)(e,"count"))>0?y.showLikes(e,r,{fast:!0}):e.tt&&e.tt.destroy&&e.tt.destroy()},_getReference:e=>cur.pvShown?"photo_viewer":e===cur.wallLayer?"wkview":window.mvcur&&window.mvcur.mvShown?"videoview":cur.wallType?"feed"===cur.wallType?"news"===cur.section?`feed_${cur.subsection?cur.subsection:cur.section}`:"recommended"===cur.section?"feed_recommended"+("recent"!==cur.subsection?"_"+cur.subsection:""):(0,a.inArray)(cur.section,["friends","groups","videos","photos"])?"feed_"+(cur.subsection?"_"+cur.subsection:""):`feed_${cur.section}`:"top"===cur.wallType?"wall_top":"wall_"+(cur.onepost?"one":(cur.wallType||"").indexOf("full_")?"page":"full"):cur.module,share(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(vk.widget&&!vk.id)return window.Widgets.oauth();if((0,c.isObject)(window.cur)&&(0,c.isFunction)(cur.viewAsBox))return cur.viewAsBox();var r=(0,h.parseLikeObjectId)(e),o=r.objectType,i=r.objectId;(vk.widget?window.showBox:d.showBox)("like.php",w({act:"publish_box",object:e,from_widget:vk.widget?1:0},t),{onDone:(e,t)=>{t.unauth_action_box&&(e.hide(),m.UnauthActionBox.show(t.unauth_action_box))},stat:["page.js","page.css","wide_dd.js","wide_dd.css",window.jsc("web/sharebox.js")]}),"wall"===o&&window.Wall&&window.Wall.triggerAdPostStat(i,"share_post"),cur.RpcMethods&&(cur.RpcMethods.likeFullUpdate=t=>y.update(e,window.cleanObj(t)))},clientUpdate(e,t,r,i){var n=this._getButtonsByType(e,t);if(n.length){var a=(0,c.intval)((0,o.domData)(n[0],"count"))+r;this._updateDom(e,t,a,i),this.updateExternalIndex(e,{type:t,count:a,isActive:i})}},update(e,t){if(!isNaN(parseInt(t.like_num))){var r=(0,c.isUndefined)(t.like_my)?void 0:!!(0,c.intval)(t.like_my);this._updateDom(e,v.LikeButtonTypes.like,t.like_num,r,t.like_title),this.updateExternalIndex(e,{type:v.LikeButtonTypes.like,count:t.like_num,isActive:r})}if(!isNaN(parseInt(t.share_num))){var o=(0,c.isUndefined)(t.share_my)?void 0:!!(0,c.intval)(t.share_my);this._updateDom(e,v.LikeButtonTypes.share,t.share_num,o,t.share_title),this.updateExternalIndex(e,{type:v.LikeButtonTypes.share,count:t.share_num})}if((0,a.isNumeric)(t.views_num)&&this._updateDom(e,v.LikeButtonTypes.views,t.views_num,void 0,t.views_title),(0,a.isNumeric)(t.comment_num)&&this._updateDom(e,v.LikeButtonTypes.comment,t.comment_num),t[_.REACTIONS_COUNTS_RESPONSE_FIELD]){var i=!!t.isQueueUpdate;(0,g.triggerReactionsUpdate)(e,t[_.REACTIONS_COUNTS_RESPONSE_FIELD],void 0,{isQueueUpdate:i,isUserAction:!1,previewVisibility:p.previewVisibilityUseCurrent})}},updateComments(e,t){this.update(e,{comment_num:t})},_updateDom(e,t,r,i,n){var l=this._getButtonsByType(e,t),d=t===v.LikeButtonTypes.views;if(null==l?void 0:l.length){var _="";d?_=r:r>0&&(_=vk.widget?(0,a.formatCount)(r):(0,u.langNumeric)(r,"%s",!0)),d||(r=(0,c.intval)(r));for(var p=0;p<l.length;p++){var g=l[p];if(!(0,o.hasClass)(g,"no_counter")){var m,w,y=d?l[p]:(0,h.getElementLikeButtonCount)(l[p]);if((0,s.animateCount)(y,_,{str:"auto",noWrapWidth:!d,noSpaceIfEmpty:!0}),(0,o.toggleClass)(g,"empty",r<=0),"boolean"==typeof i&&(0,o.toggleClass)(g,"active",i),(0,o.attr)(l[p],"data-count",r),(0,f.updateAriaLabelCounter)(g,r,t),d)null==g||null===(m=g.closest)||void 0===m||null===(w=m.call(g,".like_views"))||void 0===w||w.setAttribute("title",n||"");var E=l[p].tt;if(E){var S=(0,o.domByClass)(E.container,"_content"),C=(0,o.domByClass)(E.container,"_value"),N=(0,o.domByClass)(E.container,"_title"),b=(0,c.intval)((0,o.val)(C));(0,o.val)(C,r),n&&(0,o.val)(N,n),(0,c.isObject)(E)&&(E.likeInvalidated=!0),(b!==r&&b<7||!1===n)&&(t===v.LikeButtonTypes.like?g.needReinitLikesTT=!0:t===v.LikeButtonTypes.share&&(g.needReinitShareTT=!0)),t===v.LikeButtonTypes.like&&(0,o.toggleClass)(S,"me_hidden",!i),!1===n&&E.destroy&&E.destroy()}}}}},_getButtonsByType:(e,t)=>(0,o.domQuery)(`._like_${e} ._${t}, ._like_${e} [data-like-button-type="${t}"]`),showLikes(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e instanceof HTMLElement&&!e.postDontShowLikes&&(!vk.widget||!vk.show_external_auth_box)){var i=r.views?{views:1}:r.share?{published:1}:{};r.listId&&(i.list=r.listId),r.like_stats_params&&Object.assign(i,r.like_stats_params);var s=!!(0,o.geByClass1)("share",(0,o.gpeByClass)("like_wrap",e)),l=document.body,d=!1,u=getComputedStyle(e),v=(0,c.intval)(u.getPropertyValue("padding-left").replace("px","")),_=(0,c.intval)(u.getPropertyValue("padding-top").replace("px","")),p=(0,h.getElementLikeButtonIcon)(e),g=40;"wpost"===r.from&&(g=24);var m,f,w=[g-(0,o.getSize)(p)[0]/2-v,10-_],E=r.cl||"";if(r.share)E+="likes_tt_share";else if(E+="likes_tt_like","widget_community"===r.from)w[0]=6;else if("wcomments"===r.from||"widget_comments"===cur.wallType){w[0]=(0,o.getSize)(e)[0]+16-(0,o.getSize)(p)[0]/2-10}else"photo_carousel"===r.from&&(w[1]=10);if(!!(null==r?void 0:r.isFromReactionsPreview)){var S=e.querySelector("._ReactionsPreview__itemsContainer");if(S){var C=S.querySelector(".ReactionsPreviewItem"),N=getXYRect(C,!1),b=(N.width||0)/2,k=b;l=S,N.left+N.width/2>window.innerWidth/2&&(d=!0,k=S.offsetWidth-b),w[0]=-k+g}}r.share?(m="needReinitLikesTT",f="resetLikesTTTimer"):(m="needReinitShareTT",f="resetShareTTTimer"),clearTimeout(e[f]),(0,n.showTooltip)(e,{url:"/like.php",params:(0,a.extend)({act:"a_get_stats",object:t,has_share:s?1:""},i),appendEl:l,slide:15,shift:w,ajaxdt:r.fast?0:100,showdt:r.fast?0:400,hidedt:200,dir:"auto",checkLeft:!0,needLeft:d,reverseOffset:80,noZIndex:!0,hasover:!0,tip:{over:()=>{y.showLikes(e,t,r)}},typeClass:"like_tt",className:E,onHide:()=>{clearTimeout(e[f]),e[m]&&(e[f]=setTimeout((()=>{delete e[m],e.tt&&e.tt.destroy&&e.tt.destroy()}),200))}})}},showShare:function(e,t,r){y.showLikes(e,t,(0,a.extend)(r,{share:1}))},updateViews:(e,t)=>{vk.widget&&vk.show_external_auth_box||window.ajax.post("like.php",{act:"a_get_stats",object:e,views:1},{cache:1,onDone(t,r){var i=(0,o.ce)("div",{innerHTML:r});y._updateDom(e,v.LikeButtonTypes.views,t,void 0,i.innerText||i.textContent)}})},makeTemplate(e,t){if(!e)return"";(t=(0,a.extend)({buttons_prepend:"",object_raw:"",likes_count:"",liked:!1,share_count:"",shared:"",views_count:"",share_opts:{},like_opts:{},class_name:"",like_cont_class:"",like_class_name:"",[_.REACTIONS_COUNTS_RESPONSE_FIELD]:"",reactions_class_name:""},t)).like_active=t.liked?"active":"",t.share_active=t.shared?"active":"",t.comment_active="",t.likes_formatted_count=t.likes_count>0?(0,u.langNumeric)(t.likes_count,"%s",!0):"",t.share_formatted_count=t.share_count>0?(0,u.langNumeric)(t.share_count,"%s",!0):"",t.share_opts=this._convertOptsToString(t.share_opts),t.like_opts=this._convertOptsToString(t.like_opts),t.like_class_name+=t.likes_count>0?"":" empty",t.share_class_name=t.share_count>0?"":"empty";var r=t[_.REACTIONS_COUNTS_RESPONSE_FIELD],i=!!r&&Object.values(r).some((e=>!!e));return t.reactions_class_name+=i?"":" PostBottomAction--empty",(0,o.rs)(e,t)},_convertOptsToString:e=>JSON.stringify(e).replace(/\"/g,"'"),updateExternalIndex(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,h.parseLikeObjectId)(e),o=r.objectType,i=r.objectId;switch(o){case"photo":if(!cur.pvShown||!cur.pvCurPhoto||cur.pvCurPhoto.id!==i)return;var n=cur.pvListId,a=cur.pvIndex,s=cur.pvData[n][a];t.type===v.LikeButtonTypes.like?(s.likes=t.count,s.liked=t.isActive,cur.pvCommsLikes[s.id][1]=t.count):t.type===v.LikeButtonTypes.share&&(s.shares=t.count);break;case"video":if(window.mvcur&&window.mvcur.mvShown&&window.mvcur.videoRaw===i&&t.type===v.LikeButtonTypes.like){var l=window.Videoview.getMvData();l.likes=t.count,void 0!==t.isActive&&(l.liked=t.isActive,window.Videoview.playerOnLiked(t.isActive),window.Videoview.recache())}}},showLikesList(e,t){cur.viewAsBox||(0,o.hasClass)((0,o.gpeByClass)("like_btn",e),"no_counter")||(0,l.showWiki)({w:"likes/"+(0,a.clean)(t)},!1,!1,{queue:1})},showSharesList(e,t){cur.viewAsBox||(0,o.hasClass)((0,o.gpeByClass)("like_btn",e),"no_counter")||(0,l.showWiki)({w:"shares/"+(0,a.clean)(t)},!1,!1,{queue:1})}}},738046:(e,t,r)=>{"use strict";var o;r.d(t,{BatchOperationType:()=>o}),function(e){e.Add="add",e.Delete="delete"}(o||(o={}))},341319:(e,t,r)=>{"use strict";var o,i,n,a,s;r.d(t,{StoryType:()=>o,StoryEntryPoint:()=>i,StorySource:()=>n,StoryBlockType:()=>a,StoryListName:()=>s}),function(e){e.PHOTO="photo",e.VIDEO="video",e.LIVE="live"}(o||(o={})),function(e){e.SWIPE="swipe",e.NAVIGATION_BUTTON="navigation_button",e.SIT_POSTING="sit_posting",e.LINK="link",e.STORY_REPLY="story_reply",e.STORY_REPOST="story_repost",e.CATALOG_ADD="catalog_add",e.DIALOG="dialog",e.STORY_LIVE_FINISHED="story_live_finished",e.DIALOG_VKME="dialog_vkme",e.STORY_VIEWER_FINISHED="story_viewer_finished",e.PUSH_TRY_MASK="push_try_mask",e.STORY_VIEWER_TRY_MASK="story_viewer_try_mask",e.LINK_MASK="link_mask",e.POSTING="posting",e.NEW_STORY_AVATAR="new_story_avatar",e.STORY_REPLIES_LIST="story_replies_list",e.STORIES_FEED="stories_feed",e.STORIES_SEARCH_NEWS="stories_search_news",e.QUESTION_STICKER="question_sticker",e.LIST_MIDDLE="list_middle",e.ARCHIVE_EMPTY_BUTTON="archive_empty_button",e.ARCHIVE_MENU_BUTTON="archive_menu_button",e.IM="im",e.PROFILE_BUTTON="profile_button",e.SHARE="share",e.MINI_APP="mini_app",e.SYSTEM_SHARING="system_sharing",e.SHORTCUT="shortcut",e.ARCHIVE_SHARING="archive_sharing",e.STORY_VIEWER_CAMERA_BUTTON="story_viewer_camera_button",e.STORY_VIEWER_MUSIC="story_viewer_music",e.STORY_VIEWER_MUSIC_SHEET="story_viewer_music_sheet",e.REPOST_TO_STORY_ACTIVITY="repost_to_story_activity",e.CHANGE_AVATAR="change_avatar"}(i||(i={})),function(e){e.FEED="feed",e.FEED_MIDDLE="feed_middle",e.LINK="link",e.PROFILE="profile",e.IM_DIALOGS="im_dialogs",e.IM_DIALOG_HEADER="im_dialog_header",e.SNIPPET="snippet",e.REPLY="reply",e.REPLIES_LIST="replies_list",e.REPLY_STORY="reply_story",e.DISCOVER="discover",e.STORIES_MANAGE="stories_manage",e.USER_PERSONAL_CARD="user_personal_card",e.GROUP_PERSONAL_CARD="group_personal_card",e.NARRATIVE_SNIPPET="narrative_snippet",e.NARRATIVE_STORY="narrative_story",e.NARRATIVE_LINK="narrative_link",e.NARRATIVE_RECOMMENDATIONS="narrative_recommendations",e.NARRATIVE_SECTION="narrative_section",e.FAVE="fave",e.SPAMFEED="sf",e.ADS_PREVIEW="ads_preview",e.LIST_MIDDLE="list_middle",e.PLACE_STORY_LIST="place_story_list",e.SEARCH_STORY_LIST="search_story_list",e.STORY_ARCHIVE="story_archive",e.IM_MSG_LIST="im_msg_list",e.NOSPAM="nospam",e.PROFILE_SNACKBAR="profile_snackbar",e.MY_QUESTIONS="questions"}(n||(n={})),function(e){e.stories="stories",e.communityGroupedStories="community_grouped_stories",e.appGroupedStories="app_grouped_stories",e.discover="discover"}(a||(a={})),function(e){e.feed="feed",e.groups="groups",e.apps="apps",e.discover="discover"}(s||(s={}))},673023:(e,t,r)=>{"use strict";r.d(t,{UploadPhoto:()=>o.UploadPhoto});var o=r(647409)},569351:(e,t,r)=>{"use strict";var o,i,n;r.d(t,{UploadPhotoErrorCodes:()=>o,OwnerAvatarEditorPhotoTypes:()=>i,OwnerAvatarEditorMods:()=>n}),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.UPLOAD=1]="UPLOAD",e[e.NOT_ALLOWED_EXTENSION=2]="NOT_ALLOWED_EXTENSION",e[e.IMAGE_TOO_SMALL=3]="IMAGE_TOO_SMALL",e[e.IMAGE_TOO_BIG=4]="IMAGE_TOO_BIG",e[e.BAD_ASPECT_RATIO=5]="BAD_ASPECT_RATIO"}(o||(o={})),function(e){e.UPLOADED="uploaded",e.EXISTED="existed"}(i||(i={})),function(e){e[e.UPLOAD=1]="UPLOAD",e[e.SELECT=2]="SELECT",e[e.EDIT=3]="EDIT"}(n||(n={}))},647409:(e,t,r)=>{"use strict";r.d(t,{UploadPhoto:()=>a});var o=r(570655),i=r(569351),n=r(746512),a=function(){function e(e,t){this.config=(0,o.__assign)({allowedTypes:["*"]},e),this.progressCallback=t}return e.prototype.validate=function(e){var t=this.config,r=t.constraints,a=t.allowedTypes,s=t.lang,l=!1;return a&&(l=a.some((function(t){return"*"===t||t===e.type}))),l?r?(0,n.getImageSizeByBlob)(e).then((function(e){var t=r.maxWidth,n=r.minWidth,a=r.maxHeight,l=r.minHeight,c=r.maxAspectRatio,d=r.minAspectRatio,u=(0,o.__read)(e,2),h=u[0],v=u[1],_=h/v;if(h>t||v>a){var p=(s["error_"+i.UploadPhotoErrorCodes.IMAGE_TOO_BIG]||"").replace("{width}",String(t)).replace("{height}",String(a));return Promise.reject({code:i.UploadPhotoErrorCodes.IMAGE_TOO_BIG,text:p})}if(h<n||v<l){p=(s["error_"+i.UploadPhotoErrorCodes.IMAGE_TOO_SMALL]||"").replace("{width}",String(n)).replace("{height}",String(l));return Promise.reject({code:i.UploadPhotoErrorCodes.IMAGE_TOO_SMALL,text:p})}return d&&d>_||c&&_>c?Promise.reject({code:i.UploadPhotoErrorCodes.BAD_ASPECT_RATIO,text:s["error_"+i.UploadPhotoErrorCodes.BAD_ASPECT_RATIO]}):Promise.resolve(null)})).catch((function(e){return e&&e.text&&e.code?Promise.reject(e):Promise.reject({code:i.UploadPhotoErrorCodes.UNKNOWN,text:s["error_"+i.UploadPhotoErrorCodes.UNKNOWN]})})):Promise.resolve(null):Promise.reject({code:i.UploadPhotoErrorCodes.NOT_ALLOWED_EXTENSION,text:s["error_"+i.UploadPhotoErrorCodes.NOT_ALLOWED_EXTENSION]})},e.prototype.upload=function(e,t,r){var o=this;return void 0===r&&(r="file1"),this.validate(e).then((function(){return new Promise((function(n,a){var s=new XMLHttpRequest,l=new FormData;l.append(r,e),s.open("POST",t||o.config.url,!0),s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE&&200===s.status){var e=void 0;try{s.responseText&&(e=JSON.parse(s.responseText))}catch(e){a({code:i.UploadPhotoErrorCodes.UNKNOWN,text:o.config.lang["error_"+i.UploadPhotoErrorCodes.UNKNOWN]})}n(e)}},s.onerror=function(){a({code:i.UploadPhotoErrorCodes.UPLOAD,text:o.config.lang["error_"+i.UploadPhotoErrorCodes.UPLOAD]})},s.upload.onprogress=function(e){o.progressCallback&&o.progressCallback(e.loaded,e.total)},s.send(l)}))}))},e}()},746512:(e,t,r)=>{"use strict";function o(e){return t=URL.createObjectURL(e),new Promise((function(e,r){var o=new Image;o.onload=function(){var t=Number(o.height),r=Number(o.width);e([r,t])},o.onerror=function(){r()},o.onabort=function(){r()},o.src=t}));var t}r.d(t,{getImageSizeByBlob:()=>o})},41929:(e,t,r)=>{"use strict";r.d(t,{BoxModal:()=>s});var o=r(570655),i=r(667294),n=r(483295),a=r(161650),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,r=e.appearance,o=e.title,s=e.actionButtons,l=e.onClose,c=e.children,d=e.hint,u=e.hasScroll;return i.createElement("div",{className:"BoxModal"},i.createElement("div",{className:(0,n.classNames)("Modal","Modal--"+r,t)},i.createElement(a.default.Header,{title:o,onClose:l}),Boolean(c)&&i.createElement(a.default.Body,{hasScroll:u},c),Boolean(s)&&i.createElement(a.default.Footer,{actionButtons:s,hint:d})))},t.defaultProps={appearance:"white",hasScroll:!0},t}(i.Component)},465864:(e,t,r)=>{"use strict";r.d(t,{parseLikeObjectId:()=>i,likePostObjectId:()=>n,likeReplyObjectId:()=>a,getElementLikeButtonCount:()=>s,getElementLikeButtonIcon:()=>l,getElementLikeButtonLabel:()=>c});var o=r(570655);function i(e){var t=e.match(/^([a-z_]+)([0-9\-_]+)$/);if(!t)return null;var r=(0,o.__read)(t,3);return{objectType:r[1],objectId:r[2]}}var n=function(e){return"wall"+e},a=function(e){return"wall_reply"+e},s=function(e){var t;return null!==(t=null==e?void 0:e.querySelector(".like_button_count, ._like_button_count"))&&void 0!==t?t:void 0},l=function(e){var t;return null!==(t=null==e?void 0:e.querySelector(".like_button_icon, ._like_button_icon"))&&void 0!==t?t:void 0},c=function(e){var t;return null!==(t=e.querySelector(".like_button_label, ._like_button_label"))&&void 0!==t?t:void 0}},325698:(e,t,r)=>{"use strict";r.d(t,{LikeButtonTypes:()=>o});var o={like:"like",share:"share",views:"views",comment:"comment"}},560717:(e,t,r)=>{"use strict";r.d(t,{highlightModule:()=>c});var o,i,n=r(601261),a=r(635429),s=r(803834),l=r(315544);function c(e){var t,r=document.getElementById(e.module);if(r&&r.classList.contains("module")){window.cur.__narrowBarForceNotFixed=!0;var c=e.speed?e.speed:300;(0,s.scrollToY)((0,l.getXY)(r)[1]-100,c);var d=function(){o&&(o.hideTT(),(0,s.enableBodyScroll)(),delete window.cur.__narrowBarForceNotFixed,(0,a.updateNarrow)(),e.onClose&&e.onClose())};(o=new n.default(r,e.text,{highlight:!0,width:250,offset:[0,-17],side:"bottom",withCloseButton:!0,onBGClick:d,onCloseButtonClick:d})).show(),(0,s.disableBodyScroll)(),e.autoCancelDelay&&(i=setTimeout((function(){d(),i=null}),e.autoCancelDelay),null===(t=window.cur.destroy)||void 0===t||t.push((function(){i&&clearTimeout(i)})))}}},856901:(e,t,r)=>{"use strict";r.d(t,{PROFILE_MEDIA_NARROW_BLOCK_ID:()=>o});var o="profile_media_narrow_block"},908706:(e,t,r)=>{"use strict";r.d(t,{isVariantInActionStatusBar:()=>i,isVariantHidden:()=>n,previewVisibilityUseCurrent:()=>a,isIntentPreviewInActionStatusBar:()=>s,isIntentPreviewHidden:()=>l,isIntentPreviewUseCurrent:()=>c,previewVisibilityIntentForVariant:()=>d,parsePreviewVariant:()=>u});var o=r(404608),i=function(e){return e===o.PreviewVariantActionStatusBar},n=function(e){return e===o.PreviewVariantHidden},a={kind:"useCurrent"},s=function(e){return e.kind===o.PreviewVariantActionStatusBar},l=function(e){return e.kind===o.PreviewVariantHidden},c=function(e){return"useCurrent"===e.kind},d=function(e){return e?{kind:e}:a},u=function(e){return o.PreviewVariants.includes(e)?e:void 0}},404608:(e,t,r)=>{"use strict";r.d(t,{PreviewVariantActionStatusBar:()=>o,PreviewVariantHidden:()=>i,PreviewVariants:()=>n});var o="action_status_bar",i="hidden",n=[o,i]},95146:(e,t,r)=>{"use strict";r.d(t,{SUPPORTED_OBJECT_TYPES:()=>o,SIZE_32:()=>i,SIZE_40:()=>n,SIZE_96:()=>a,SIZE_128:()=>s,REACTIONS_COUNTS_RESPONSE_FIELD:()=>l,WK_SECTION_PREFIX_REACTIONS:()=>c});var o={wall:"wall",wall_reply:"wall_reply"},i={width:32,height:32},n={width:40,height:40},a={width:96,height:96},s={width:128,height:128},l="reactions_counts",c="reactions"},665872:(e,t,r)=>{"use strict";r.d(t,{reactionsCountsUpdatePayload:()=>n,isReactionsFullUpdatePayload:()=>a,reactionsCountsOnlyUpdatePayload:()=>s});var o=r(570655),i=r(571904),n=function(e,t){return(0,o.__assign)((0,o.__assign)({kind:i.PayloadKindFull},e),{reactionIdState:{reactionId:t.id}})},a=function(e){return e.kind===i.PayloadKindFull},s=function(e){return(0,o.__assign)({kind:i.PayloadKindCountsOnly},e)}},571904:(e,t,r)=>{"use strict";r.d(t,{PayloadKindCountsOnly:()=>o,PayloadKindFull:()=>i});var o="counts_only",i="counts_with_current_reaction"},107337:(e,t,r)=>{"use strict";r.d(t,{triggerReactionsUpdate:()=>s});var o=r(465864),i=r(95146),n=r(453580),a=r(665872),s=function(e,t,r,s){var l=(0,o.parseLikeObjectId)(e);l&&l.objectType===i.SUPPORTED_OBJECT_TYPES.wall&&l.objectId?(0,n.emitEvent)(n.WallDataEvents.post_reactions_counts_update,function(e,t,r,o){var i={counts:e,isFromWkLayer:null==t?void 0:t.isFromWkLayer,isPrimaryLikeButtonClick:null==t?void 0:t.isPrimaryLikeButtonClick,isQueueUpdate:null==t?void 0:t.isQueueUpdate,isUserAction:t.isUserAction,postFullId:r.objectId,previewVisibility:t.previewVisibility,reactionIdState:o?{reactionId:o.id}:void 0};return o?(0,a.reactionsCountsUpdatePayload)(i,o):(0,a.reactionsCountsOnlyUpdatePayload)(i)}(t,s,l,r)):l&&l.objectType===i.SUPPORTED_OBJECT_TYPES.wall_reply&&l.objectId?(0,n.emitEvent)(n.WallDataEvents.reply_reactions_counts_update,{counts:t,replyFullId:l.objectId,reactionIdState:r?{reactionId:r.id}:void 0}):console.warn("Unsupported reactions object update",e)}},814200:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var o=r(40906),i=r(241926),n=r(652745),a=r(849464),s=r(47612),l=r(125696);const c=function(){function e(){var e=this;this.destroy=function(){e.gallery&&e.gallery.destroy()},this.moduleEl=document.querySelector(".narratives_module"),this.isWide=this.moduleIsWide(this.moduleEl),this.initGallery(),this.needOnBoard()&&this.showOnboardTooltipIfNeeded(),window.cur.destroy&&window.cur.destroy.push((function(){e.destroy()}))}return e.prototype.initGallery=function(){if(this.isWide&&(this.galleryEl=document.querySelector(".NarrativeBlock"),this.galleryEl)){var e=this.galleryEl.querySelectorAll(".ui_gallery_item"),t={scrollY:!1};(!e||e.length<7)&&(t.scrollX=!1),this.gallery=new s.UIGallery(this.galleryEl,t)}},e.prototype.moduleIsWide=function(e){if(e){var t=e.getAttribute("data-is-wide");return!!(0,o.intval)(t)}return!1},e.prototype.getOnboardHash=function(){var e;return null===(e=this.moduleEl)||void 0===e?void 0:e.dataset.onboardHash},e.prototype.openNarrativeBox=function(){var e=this.getOwnerId(),t=e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club;this.showBox(),(0,a.sendNarrativeAnalytic)(a.NarrativeAnalyticEventType.openNarrativeList,{ownerId:e},t)},e.prototype.seeMore=function(){var e=this.getOwnerId(),t=e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club;this.showBox(),(0,a.sendNarrativeAnalytic)(a.NarrativeAnalyticEventType.seeMore,{ownerId:e},t)},e.prototype.showBox=function(){var e=this.getOwnerId(),t={ownerId:e,onSave:function(){return(0,n.updateNarrativeBlock)()},onRemove:function(){return(0,n.updateNarrativeBlock)()},onReorder:function(){return(0,n.updateNarrativeBlock)()},navScreen:e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club};(0,i.showNarrativeBox)(t)},e.prototype.showNarrativeEditorBox=function(){var e=this.getOwnerId(),t=e>0?a.NarrativeAnalyticNavScreen.profile:a.NarrativeAnalyticNavScreen.club;if((0,a.sendNarrativeAnalytic)(a.NarrativeAnalyticEventType.createNarrative,{ownerId:e},t),e<0)window.nav.go(location.pathname+"?act=narrative_create");else{var r={onSave:function(){return(0,n.updateNarrativeBlock)()},navScreen:t};(0,i.showNarrativeEditorBox)(e,r)}},e.prototype.getOwnerId=function(){return(0,o.intval)(window.cur.oid)},e.prototype.showOnboardTooltipIfNeeded=function(){var e=this.getOnboardHash();e&&(window.cur.storyLayer&&l.hideAllLayers(!0),window.boxQueue.hideAll(),(0,n.highlightNarrativeBlock)(e))},e.prototype.needOnBoard=function(){return Boolean(window.cur.needNarrativeOnboard)},e}()},494538:(e,t,r)=>{"use strict";r.d(t,{InputWithPrefix:()=>s});var o=r(570655),i=r(667294),n=r(483295),a=r(386409),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputRef=i.createRef(),t.componentRef=i.createRef(),t}return(0,o.__extends)(t,e),t.prototype.notaBene=function(){var e,t=null===(e=this.componentRef)||void 0===e?void 0:e.current;t&&(0,a.notaBene)(t)},t.prototype.focus=function(){var e,t;null===(t=null===(e=this.inputRef)||void 0===e?void 0:e.current)||void 0===t||t.focus()},t.prototype.render=function(){var e=this.props,t=e.className,r=e.prefix,a=(0,o.__rest)(e,["className","prefix"]);return i.createElement("div",{className:(0,n.classNames)("InputWithPrefix",t),ref:this.componentRef},i.createElement("div",{className:"InputWithPrefix__text"},r),i.createElement("input",(0,o.__assign)({className:"InputWithPrefix__input"},a,{ref:this.inputRef})))},t}(i.Component)},115985:(e,t,r)=>{"use strict";r.d(t,{NarrativeBox:()=>k});var o=r(570655),i=r(667294),n=r(41929),a=r(288420),s=r(41650),l=r(902119),c=r(709652),d=r(113165),u=r(385597),h=r(387142),v=r(439664),_=r(241926),p=r(486125),g=r(40906),m=r(664891),f=r(753449),w=r(850167),y=r(542041),E=r(109542),S=r(117173),C=r(281536),N=r(815653),b=r(849464),k=function(e){function t(t){var r=e.call(this,t)||this;return r.getBoxActionButtons=function(){var e=r.props,t=e.onClose,o=e.boxData,n=e.type,l=[i.createElement(a.default,{key:"close",appearance:"primary",onClick:function(){return t()}},(0,s.getLang)("global_close"))];if(n===c.BoxType.edit&&o.userId===o.ownerId){var d=o.ownerDomain||"id"+o.userId;l.unshift(i.createElement(m.default,{key:"archive",href:d+"?w=stories",onClick:function(){t(),(0,w.showWiki)({w:"stories"})},className:"NarrativeBox__additionalFooterButton"},(0,s.getLang)("stories_archive")))}return l},r.onNarrativeClick=function(e,t){if(!e.ctrlKey&&!e.metaKey){e.preventDefault(),e.stopPropagation();var o=r.props.list?r.props.list:"narrative"+t.ownerId+"_"+t.id;(0,d.showNarrative)(t.ownerId,t.id,0,o,{trackCode:r.props.trackCode,source:r.props.source})}},r.onCreateNarrativeClick=function(){var e=r.props,t=e.boxData,o=e.navScreen,i=t.ownerId;if((0,b.sendNarrativeAnalytic)(b.NarrativeAnalyticEventType.createNarrative,{ownerId:i},o),i>0)r.openNarrativeEditorBox();else{var n=t.ownerDomain?t.ownerDomain:"club"+-i;window.open("https://"+location.hostname+"/"+n+"?act=narrative_create")}},r.openNarrativeEditorBox=function(e){var t=r.props,i=t.onSave,n=t.boxData,a=t.onClose,s=t.navScreen;if(i){var l=[];(null==e?void 0:e.stories.length)&&(l=(0,o.__spreadArray)([],(0,o.__read)(e.stories)));var c={narrative:e,selectedStories:l,publishHash:n.publishHash,onSave:function(e){i(e),a()},navScreen:s};(0,_.showNarrativeEditorBox)(n.ownerId,c)}},r.getNarrativeItemActions=function(e){var t=[];if(r.canEdit())t.push({text:(0,s.getLang)("global_edit"),onClick:function(){return r.editNarrative(e)}}),t.push({text:(0,s.getLang)("stories_share"),onClick:function(){return r.shareNarrative(e)}}),t.push({separator:!0}),t.push({text:(0,s.getLang)("global_delete"),onClick:function(){return r.removeNarrative(e)}});else{var o=e.isBookmarked?(0,s.getLang)("global_remove_from_bookmarks"):(0,s.getLang)("global_add_to_bookmarks");t.push({text:o,onClick:function(){return r.bookmarkNarrative(e)}}),t.push({text:(0,s.getLang)("stories_share"),onClick:function(){return r.shareNarrative(e)}})}return t},r.state={isLoad:!1,draggingNarrativeRawId:""},r.scrollContainerRef=i.createRef(),r.gridRef=i.createRef(),r.sentinelRef=i.createRef(),r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,r=t.narratives,o=t.onClose,a=t.boxData,s=this.state,l=s.isLoad,c=s.draggingNarrativeRawId,d=r.length<a.count,h=this.canEdit();return i.createElement(n.BoxModal,{className:"NarrativeBox",title:this.getTitle(),actionButtons:this.getBoxActionButtons(),onClose:o,hasScroll:!1},i.createElement("div",{className:"NarrativeBox__scrollContainer",ref:this.scrollContainerRef},i.createElement("div",{className:"NarrativeBox__scrollInner"},i.createElement("div",{className:"NarrativeBox__list",ref:this.gridRef},h&&i.createElement(i.Fragment,null,i.createElement(u.NarrativeRowCreation,{key:"create",onClick:this.onCreateNarrativeClick}),r.map((function(t){return i.createElement(E.NarrativeRow,{className:S.BOX_ITEM_DRAGGABLE_CLASS,narrative:t,key:t.rawId,onClick:function(r){return e.onNarrativeClick(r,t)},aside:i.createElement("div",{className:"NarrativeBox__aside"},t.rawId===c&&i.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--more"},i.createElement(C.default,null)),t.rawId!==c&&i.createElement(f.default,{position:"b",align:"center",trigger:"hover",data:e.getNarrativeItemActions(t)},i.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--more"},i.createElement(C.default,null))),i.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--burger"},i.createElement(N.default,null)))})}))),!h&&i.createElement(i.Fragment,null,r.map((function(t){return i.createElement(E.NarrativeRow,{narrative:t,key:t.rawId,onClick:function(r){return e.onNarrativeClick(r,t)},aside:i.createElement("div",{className:"NarrativeBox__aside"},i.createElement(f.default,{position:"b",align:"right",trigger:"hover",data:e.getNarrativeItemActions(t)},i.createElement("div",{className:"NarrativeBox__action NarrativeBox__action--more"},i.createElement(C.default,null))))})})))),l&&i.createElement("div",{className:"NarrativeBox__loader",key:"loader"},i.createElement(v.default,null)),d&&i.createElement("div",{className:"NarrativeBox__sentinel",ref:this.sentinelRef}))))},t.prototype.canEdit=function(){var e=this.props,t=e.type,r=e.onSave,o=e.onReorder,i=e.onRemove;return t===c.BoxType.edit&&Boolean(r)&&Boolean(o)&&Boolean(i)},t.prototype.componentDidMount=function(){this.initSorter(),this.observeNarrativeScrollIfNeeded()},t.prototype.componentWillUnmount=function(){this.deInitSorter(),this.unObserveNarrativeScrollIfNeeded()},t.prototype.editNarrative=function(e){var t=this.props.boxData;(0,b.sendNarrativeAnalytic)(b.NarrativeAnalyticEventType.clickToEditNarrative,e,this.props.navScreen),t.ownerId>0?this.openNarrativeEditorBox(e):window.open("https://"+location.hostname+location.pathname+"?act=narrative_edit&nid="+e.id)},t.prototype.shareNarrative=function(e){y.Likes.share("narrative"+e.rawId),(0,b.sendNarrativeAnalytic)(b.NarrativeAnalyticEventType.shareNarrative,e,this.props.navScreen)},t.prototype.bookmarkNarrative=function(e){var t=this.props.onBookmark;(0,w.bookmark)(e.ownerId,e.id,"narrative",e.bookmarkHash,e.isBookmarked),(0,b.sendNarrativeAnalytic)(b.NarrativeAnalyticEventType.addToBookmarks,e,this.props.navScreen),t(e)},t.prototype.removeNarrative=function(e){var t,r;null===(r=(t=this.props).onRemove)||void 0===r||r.call(t,e)},t.prototype.observeNarrativeScrollIfNeeded=function(){var e=this,t=this.props,r=t.narratives,o=t.boxData;if(r.length<o.count){var i=this.scrollContainerRef.current,n=this.sentinelRef.current;if(!n)return;this.observer=new IntersectionObserver((function(t){t.forEach((function(t){t.intersectionRatio>0&&e.loadViewers()}))}),{threshold:[0],root:i,rootMargin:"0px 0px 480px 0px"}),this.observer.observe(n)}},t.prototype.unObserveNarrativeScrollIfNeeded=function(){this.observer&&this.observer.disconnect()},t.prototype.loadViewers=function(){var e=this,t=this.props.loadMore;this.state.isLoad||(this.setState({isLoad:!0}),t().finally((function(){e.setState({isLoad:!1})})))},t.prototype.initSorter=function(){var e,t,r=this,o=this.props.boxData;if(this.canEdit()){var i=null===(e=this.scrollContainerRef)||void 0===e?void 0:e.current,n=null===(t=this.gridRef)||void 0===t?void 0:t.current;if(n&&i){var a={dragThreshold:0,wrapNode:i,onDragFinish:function(){r.setState({draggingNarrativeRawId:""})},onDragStart:function(e){var t=r.getNarrativeIdByEl(e);r.setState({draggingNarrativeRawId:o.ownerId+"_"+t})},onReorder:function(e){var t=r.getNarrativeIdByEl(e),o=Array.from(n.querySelectorAll("."+S.BOX_ITEM_DRAGGABLE_CLASS));if(1!==o.length){var i=0,a=0,s=o.findIndex((function(e){return r.getNarrativeIdByEl(e)===t}));o[s-1]&&(i=r.getNarrativeIdByEl(o[s-1])),o[s+1]&&(a=r.getNarrativeIdByEl(o[s+1])),r.saveReorder(t,a,i)}}};this.sorter=new h.default(n,"",a)}}},t.prototype.saveReorder=function(e,t,r){var o=this,i=this.props,n=i.boxData,a=i.onReorder;if(a){var l=n.ownerId;window.ajax.post("al_stories.php",{act:"narratives_reorder",narrative_id:e,before_narrative_id:t,after_narrative_id:r,hash:n.reorderHash,owner_id:l},{onDone:function(){var t,r=o.props.narratives,i=null===(t=o.gridRef)||void 0===t?void 0:t.current;if(i){var n=Array.from(i.querySelectorAll("."+S.BOX_ITEM_DRAGGABLE_CLASS)),s=[];n.forEach((function(e){var t=o.getNarrativeIdByEl(e),i=r.find((function(e){return e.id===t}));i&&s.push(i)})),(0,b.sendNarrativeAnalytic)(b.NarrativeAnalyticEventType.changeSort,{ownerId:l,id:e},o.props.navScreen),a(s)}},onFail:function(e){return(0,p.showDoneBox)(e||(0,s.getLang)("global_error")),!0}})}},t.prototype.getNarrativeIdByEl=function(e){return(0,g.intval)(e.getAttribute("data-id"))},t.prototype.getTitle=function(){var e=this.props,t=e.title,r=e.boxData,o=e.showNarrativeNumber;return i.createElement(l.NarrativeBoxTitle,{title:t||(0,s.getLang)("stories_narratives_title"),count:r.count,showNarrativeNumber:o})},t.prototype.deInitSorter=function(){this.sorter&&this.sorter.destroy()},t.defaultProps={type:c.BoxType.view,showNarrativeNumber:!0},t}(i.Component)},709652:(e,t,r)=>{"use strict";var o;r.d(t,{BoxType:()=>o}),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(o||(o={}))},902119:(e,t,r)=>{"use strict";r.d(t,{NarrativeBoxTitle:()=>i});var o=r(667294),i=function(e){var t=e.title,r=e.count,i=void 0===r?0:r,n=e.showNarrativeNumber,a=void 0===n||n;return o.createElement("div",{className:"NarrativeBoxTitle"},t,a&&i>0&&o.createElement("span",{className:"NarrativeBoxTitle__count"},i))}},744451:(e,t,r)=>{"use strict";r.d(t,{NarrativeChooseBox:()=>f});var o=r(570655),i=r(667294),n=r(41929),a=r(288420),s=r(41650),l=r(118690),c=r(483295),d=r(423985),u=r(385597),h=r(109542),v=r(486125),_=r(241926),p=r(113165),g=r(738046),m=r(849464),f=function(e){function t(t){var r=e.call(this,t)||this;return r.loadMore=function(){var e=r.props,t=e.loadMore,i=e.story,n=r.state.selectedNarrativeIds;return t().then((function(e){void 0===e&&(e=[]),r.setState({selectedNarrativeIds:(0,o.__assign)((0,o.__assign)({},n),r.getSelectedNarrativeIdsMap(i.id,e))})}))},r.onCheckboxClick=function(e){var t=r.state.selectedNarrativeIds,i=(0,o.__assign)({},t);i[e.id]?delete i[e.id]:i[e.id]=!0,r.setState({selectedNarrativeIds:i})},r.getBoxActionButtons=function(){var e=r.props,t=e.onClose,o=e.story,n=e.narratives,c=r.state,d=c.isLoad,u=c.selectedNarrativeIds,h=r.getSelectedNarrativeIdsMap(o.id,n),v=r.getDiffOperations(o.id,u,h);return[i.createElement(a.default,{key:"close",appearance:"tertiary",onClick:function(){return t()}},(0,s.getLang)("global_close")),i.createElement(l.default,{key:"save",appearance:"primary",disabled:!v.length,onClick:r.save,loading:d},(0,s.getLang)("global_save"))]},r.save=function(){var e=r.props,t=e.story,o=e.narratives,i=e.boxData,n=e.onClose,a=e.onSave,l=e.navScreen,c=r.state.selectedNarrativeIds,d=r.getSelectedNarrativeIdsMap(t.id,o),u=r.getDiffOperations(t.id,c,d),h=Boolean(Object.keys(c).length),_=i.ownerId;r.setState({isLoad:!0}),window.ajax.post("al_stories.php",{act:"batch_edit",owner_id:_,operations:JSON.stringify(u),hash:i.editHash},{onDone:function(){a(h),n(),(0,m.sendNarrativeAnalytic)(m.NarrativeAnalyticEventType.addStoryToNarrative,{ownerId:_},l),(0,v.showDoneBox)(r.getDoneText(u))},onFail:function(e){return(0,v.showDoneBox)(e||(0,s.getLang)("global_error")),!0},hideProgress:function(){r.setState({isLoad:!1})}})},r.onCreateNarrativeClick=function(){var e=r.props,t=e.story,o=e.narratives,i=e.onSave,n=e.onClose,a=e.boxData,s=e.navScreen,l=a.ownerId;if(l>0){var c=r.getSelectedNarrativeIdsMap(t.id,o),d=Boolean(Object.keys(c).length),u={selectedStories:[t],onSave:function(){d=!0},onClose:function(){i(d),n()},navScreen:s};return(0,_.showNarrativeEditorBox)(l,u),void(0,m.sendNarrativeAnalytic)(m.NarrativeAnalyticEventType.createNarrative,{ownerId:l},s)}var h=a.ownerDomain?a.ownerDomain:"club"+-a.ownerId;window.nav.go(h+"?act=narrative_create&story_id="+t.id)},r.onNarrativeClick=function(e,t){e.ctrlKey||e.metaKey||((0,p.showNarrative)(t.ownerId,t.id,0,"narrative"+t.ownerId+"_"+t.id),e.preventDefault(),e.stopPropagation())},r.state={isLoad:!1,selectedNarrativeIds:r.getSelectedNarrativeIdsMap(t.story.id,t.narratives)},r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,r=t.onClose,o=t.narratives,a=t.boxData,l=this.state.selectedNarrativeIds,v=o.length<a.count;return i.createElement(n.BoxModal,{className:"NarrativeChooseBox",title:(0,s.getLang)("stories_narrative_choosing"),actionButtons:this.getBoxActionButtons(),onClose:r,hasScroll:!1,appearance:"blue"},i.createElement(d.default,{className:"NarrativeChooseBox__list",itemHeight:80,loadMore:this.loadMore,hasMore:v},i.createElement(u.NarrativeRowCreation,{key:"create",onClick:this.onCreateNarrativeClick,clickable:!0,size:50}),o.map((function(t){return i.createElement(h.NarrativeRow,{narrative:t,key:t.rawId,onClick:function(){return e.onCheckboxClick(t)},size:50,noBorder:!0,clickable:!0,aside:i.createElement("div",{className:(0,c.classNames)("NarrativeChooseBox__checkbox",{"NarrativeChooseBox__checkbox--checked":l[t.id]})})})}))))},t.prototype.getDoneText=function(e){var t=e.filter((function(e){return e.op===g.BatchOperationType.Add})).length;if(t>1)return(0,s.getLang)("stories_saved_in_narratives_text");if(1===t)return(0,s.getLang)("stories_saved_in_narrative_text");var r=e.filter((function(e){return e.op===g.BatchOperationType.Delete})).length;return r>1?(0,s.getLang)("stories_deleted_in_narratives_text"):1===r?(0,s.getLang)("stories_deleted_in_narrative_text"):(0,s.getLang)("stories_settings_saved")},t.prototype.getDiffOperations=function(e,t,r){var o=[];return Object.keys(t).forEach((function(t){r[t]||o.push({op:g.BatchOperationType.Add,story_id:e,narrative_id:Number(t)})})),Object.keys(r).forEach((function(r){t[r]||o.push({op:g.BatchOperationType.Delete,story_id:e,narrative_id:Number(r)})})),o},t.prototype.getSelectedNarrativeIdsMap=function(e,t){return t.reduce((function(t,r){return r.stories.find((function(t){return t.id===e}))&&(t[r.id]=!0),t}),{})},t}(i.Component)},833623:(e,t,r)=>{"use strict";r.d(t,{MAX_THUMB_HEIGHT:()=>v,MAX_THUMB_WIDTH:()=>_,NarrativeCoverCropper:()=>p});var o=r(570655),i=r(667294),n=r(41929),a=r(288420),s=r(41650),l=r(343390),c=r(654612),d=r(66433),u=r(118690),h=r(961540),v=604,_=468,p=function(e){function t(t){var r=e.call(this,t)||this;return r.onSaveCrop=function(){var e=r.props,t=e.onSave,o=e.onClose,i=e.coverUrl,n=r.crop;n&&(r.setState({isLoading:!0}),(0,h.getCroppedImage)(i,n.left,n.top,n.width,n.height).then((function(e){return t(r.getCropForSaving(n),e.src)})).then(o).catch((function(e){r.setState({isLoading:!1}),(0,c.showFastBox)((0,s.getLang)("global_error"),e||(0,s.getLang)("global_unknown_error")),console.error(e),(0,d.logError)(new Error("error with onSaveCrop"+(e?": "+e:"")))})))},r.onCropUpdate=function(e){r.crop=e},r.state={isLoading:!1},r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,r=e.coverUrl,o=e.coverHeight,c=e.coverWidth,d=e.thumbHeight,h=e.thumbWidth,v=e.crop,_=this.state.isLoading;return i.createElement(n.BoxModal,{className:"NarrativeCoverCropper",appearance:"white",title:(0,s.getLang)("stories_cover_cropper_title"),onClose:t,hasScroll:!1},i.createElement("div",{className:"NarrativeCoverCropper__inner"},i.createElement("div",{className:"NarrativeCoverCropper__info"},i.createElement("div",null,(0,s.getLang)("stories_cover_cropper_info_1")),i.createElement("div",null,(0,s.getLang)("stories_cover_cropper_info_2"))),i.createElement("div",{className:"NarrativeCoverCropper__frame"},i.createElement(l.PhotoAreaSelector,{className:"NarrativeCoverCropper__tagger",imgSrc:r,imgHeight:o,imgWidth:c,previewHeight:d,previewWidth:h,minHeight:75,minWidth:75,isSquare:!0,preview100:!0,cropRect:this.getCropForTagger(v),onCropUpdated:this.onCropUpdate})),i.createElement("div",{className:"NarrativeCoverCropper__footer"},i.createElement(u.default,{loading:_,onClick:this.onSaveCrop},(0,s.getLang)("stories_cover_next")),i.createElement(a.default,{disabled:_,appearance:"secondary",onClick:t},(0,s.getLang)("stories_cover_back")))))},t.prototype.getCropForTagger=function(e){var t,r=this.props,o=r.coverWidth,i=r.coverHeight;if(e){var n=Math.round(e.width*o),a=Math.round(e.height*i);if(Math.abs(a-n)>1)return t;a=n,t={top:Math.round(e.y*i),left:Math.round(e.x*o),width:n,height:a}}return t},t.prototype.getCropForSaving=function(e){var t=this.props,r=t.coverWidth,o=t.coverHeight;return{y:e.top/o,x:e.left/r,width:e.width/r,height:e.height/o}},t}(i.Component)},884215:(e,t,r)=>{"use strict";r.d(t,{NarrativeCreateLiteBox:()=>v});var o=r(570655),i=r(667294),n=r(41650),a=r(118690),s=r(41929),l=r(695724),c=r(117173),d=r(349062),u=r(551907),h=r(386409),v=function(e){function t(t){var r=e.call(this,t)||this;return r.onNameChange=function(e){var t=e.target.value,o=(0,l.trim)(t)?t:"";r.setState({name:o})},r.getBoxActionButtons=function(){var e=r.state.isLoad;return[i.createElement(a.default,{key:"publish",appearance:"primary",onClick:r.save,loading:e},(0,n.getLang)("groups_edit_narrative_publish"))]},r.save=function(){var e=r.state.isLoad,t=r.state.name,o=void 0===t?"":t;e||((o=(0,l.trim)(o))?(r.setState({isLoad:!0}),r.props.onSave(o).catch((function(){r.setState({isLoad:!1})}))):(0,h.notaBene)(r.nameInputRef.current))},r.state={isLoad:!1,name:"",coverStory:t.stories[0]},r.nameInputRef=i.createRef(),r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,r=e.ownerName,o=e.stories,a=this.state,l=a.name,h=a.coverStory,v=null==h?void 0:h.preview;return i.createElement(s.BoxModal,{className:"NarrativeCreateLiteBox",title:(0,n.getLang)("stories_creating_narrative"),actionButtons:this.getBoxActionButtons(),onClose:t,hasScroll:!1,appearance:"blue"},i.createElement("div",{className:"NarrativeCreateLiteBox__inner"},i.createElement("div",{className:"NarrativeCreateLiteBox__title"},(0,n.getLang)("groups_edit_narrative_title")),i.createElement("input",{type:"text",className:"NarrativeCreateLiteBox__nameInput",value:l,onChange:this.onNameChange,placeholder:(0,n.getLang)("stories_enter_name"),maxLength:c.NARRATIVE_MAX_TITLE_LENGTH,ref:this.nameInputRef,autoFocus:!0}),i.createElement("div",{className:"NarrativeCreateLiteBox__title"},(0,n.getLang)("groups_edit_narrative_preview")),i.createElement("div",{className:"NarrativeCreateLiteBox__text"},(0,n.getLang)("groups_edit_narrative_pin_text")),i.createElement("div",{className:"NarrativeCreateLiteBox__previews"},i.createElement("div",{className:"NarrativeCreateLiteBox__previewWrapper"},i.createElement("div",{className:"NarrativeCreateLiteBox__previewTitle"},(0,n.getLang)("stories_narrative_preview_block_title")),i.createElement("div",{className:"NarrativeCreateLiteBox__smallPreview"},i.createElement(d.NarrativeItemPreviewCover,{cover:v}),i.createElement("span",{className:"NarrativeCreateLiteBox__smallPreviewName"},l||(0,n.getLang)("stories_narrative_name_full")))),i.createElement("div",{className:"NarrativeCreateLiteBox__previewWrapper NarrativeCreateLiteBox__previewWrapper--snippet"},i.createElement("div",{className:"NarrativeCreateLiteBox__previewTitle"},(0,n.getLang)("stories_narrative_preview_feed_title")),i.createElement(u.NarrativeSnippet,{className:"NarrativeCreateLiteBox__snippet",ownerName:r,coverUrl:v,title:l,storyCount:o.length})))))},t}(i.Component)},111898:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditor:()=>y});var o=r(570655),i=r(667294),n=r(41650),a=r(887157),s=r(288420),l=r(386409),c=r(486125),d=r(118690),u=r(720516),h=r(956252),v=r(695724),_=r(41929),p=r(652745),g=r(495893),m=r(405101),f=r(849464),w=r(303562),y=function(e){function t(t){var r=e.call(this,t)||this;r.onSelectedStoriesUpdate=function(e){void 0===e&&(e=[]);var t=r.props.storyMap,o=r.state.cover,i=null==o?void 0:o.coverStoryId,n={selectedStoryIds:e};if((null==o?void 0:o.customPhotoId)||i&&e.includes(i))e.length||(n.cover=null);else{var a=e[0];e[0]?n.cover={url:t[a].preview,coverStoryId:a}:n.cover=null}r.setState(n)},r.openCoverSelection=function(){var e=r.state.cover;((null==e?void 0:e.coverStoryId)||(null==e?void 0:e.customPhotoId))&&r.setState({section:a.EditorSectionType.cover})},r.confirmCover=function(e){var t=r.state.cover;r.setState({cover:e||t,section:a.EditorSectionType.main})},r.onNameChange=function(e){var t=e.target.value,o=(0,v.trim)(t)?t:"";r.setState({name:o})},r.close=function(e,t){var i=r.props,n=i.ownerId,a=i.narrativeRawId,s=i.navScreen;if(!e){var l="";a&&(l=(0,o.__read)(a.split("_"),2)[1]),(0,f.sendNarrativeAnalytic)(f.NarrativeAnalyticEventType.close,{ownerId:n,id:Number(l)},s)}r.props.close(t)},r.onSave=function(e){r.props.onSave(e)},r.getFooterButtons=function(){var e=r.props.type,t=r.state,o=t.selectedStoryIds,l=t.loading;return[i.createElement(s.default,{key:"close",appearance:"tertiary",onClick:function(){return r.close(!1)},disabled:l},(0,n.getLang)("global_cancel")),i.createElement(d.default,{loading:l,key:"save",onClick:r.save,disabled:0===o.length},e===a.EditorModeType.edit?(0,n.getLang)("global_save"):(0,n.getLang)("stories_create_narrative"))]},r.save=function(){var e=r.props,t=e.publishHash,i=e.editHash,s=e.type,d=e.navScreen,u=e.ownerId,h=r.state,_=h.cover,g=h.loading,m=r.getSelectedStories(),w=r.state.name,y=void 0===w?"":w,E=r.props.narrativeRawId;if(!g)if(y=(0,v.trim)(y)){if((null==_?void 0:_.coverStoryId)||(null==_?void 0:_.customPhotoId)){var S="publish_narrative",C=t;s===a.EditorModeType.edit&&(S="edit_narrative",C=i);var N={act:S,owner_id:u,title:y,hash:C,story_ids:(0,p.prepareStoriesForPublishing)(m)};if(E){var b=(0,o.__read)(E.split("_"),2)[1];N.narrative_id=b}_.customPhotoId&&(N.custom_cover_photo_id=_.customPhotoId),_.coverStoryId&&(N.cover_story_id=_.coverStoryId),_.crop&&(N.crop_y=_.crop.y,N.crop_x=_.crop.x,N.crop_height=_.crop.height,N.crop_width=_.crop.width),window.ajax.post("al_stories.php",N,{onDone:function(e){E||(E=u+"_"+e);var t=r.getPublishDoneHtml(E,y,s);r.onSave(E),r.close(!0,(function(){return(0,c.showDoneBox)(t)})),(0,f.sendNarrativeAnalytic)(s===a.EditorModeType.edit?f.NarrativeAnalyticEventType.editNarrative:f.NarrativeAnalyticEventType.publishNarrative,{ownerId:Number(u),id:Number(e)},d)},onFail:function(e){return(0,c.showDoneBox)(e||(0,n.getLang)("global_error")),!0},hideProgress:function(){r.setState({loading:!1})}}),r.setState({loading:!0})}}else r.dataPanelRef.current&&(0,l.notaBene)(r.dataPanelRef.current.getInputEl())};var u=t.cover,h=t.selectedStoryIds[0];return!u&&h&&(u={url:t.storyMap[h].preview,coverStoryId:h}),r.state={tabKey:t.activeTabKey,name:t.name,selectedStoryIds:t.selectedStoryIds,cover:u,loading:!1,section:a.EditorSectionType.main},r.dataPanelRef=i.createRef(),r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this;return this.props.appearance===a.EditorViewType.box?i.createElement(_.BoxModal,{className:"NarrativeEditor NarrativeEditor--box",appearance:"blue",title:this.getBoxTitle(),onClose:function(){return e.close()},hasScroll:!1},this.renderInner()):i.createElement("div",{className:"NarrativeEditor NarrativeEditor--page"},this.renderInner())},t.prototype.renderInner=function(){var e=this.props,t=e.storyIds,r=e.storyMap,o=e.onStoryLinkUpdate,n=e.isEditingLinksAvailable,s=e.linkData,l=e.appearance,c=e.loadMore,d=e.hasMore,v=e.coverUploadConfig,_=e.ownerId,p=this.state,f=p.name,w=p.selectedStoryIds,y=p.cover,E=p.section,S=this.getSelectedStories(),C=(null==y?void 0:y.url)||"";return i.createElement("div",{className:"NarrativeEditor__inner"},E===a.EditorSectionType.main&&i.createElement(m.NarrativeEditorSection,{appearance:l,actionFooterButtons:this.getFooterButtons()},i.createElement(h.NarrativeEditorDataPanel,{className:"NarrativeEditor__dataPanel",coverUrl:C,name:f,selectedStoriesCount:w.length,onNameChange:this.onNameChange,onSubmit:this.save,onCoverClick:this.openCoverSelection,ref:this.dataPanelRef}),i.createElement(u.NarrativeEditorStoriesTabPanel,{appearance:l,onSelectedStoriesUpdate:this.onSelectedStoriesUpdate,storyIds:t,loadMore:c,hasMore:d,selectedStoryIds:w,storyMap:r,linkData:s,isEditingLinksAvailable:n,onStoryLinkUpdate:o})),E===a.EditorSectionType.cover&&i.createElement(g.NarrativeEditorCoverSection,{ownerId:_,appearance:l,cover:y,stories:S,onSave:this.confirmCover,coverUploadConfig:v,storyMap:r}))},t.prototype.getBoxTitle=function(){var e=this.props.type;return this.state.section===a.EditorSectionType.cover?(0,n.getLang)("stories_choose_cover_title"):e===a.EditorModeType.create?(0,n.getLang)("stories_creating_narrative"):(0,n.getLang)("stories_editing_narrative")},t.prototype.getPublishDoneHtml=function(e,t,r){var i=this.props.getPublishDoneHTML;if(i)return i(e,t,r);var s=(0,o.__read)(e.split("_"),2),l=s[0],c=s[1],d="if (!event.metaKey && !event.ctrlKey) { showNarrative("+Number(l)+", "+Number(c)+", 0, 'narrative"+e+"'); return false; }";return'\n      <div class="top_result_header">\n        '+(r===a.EditorModeType.create?(0,n.getLang)("stories_narrative_created"):(0,n.getLang)("stories_narrative_edited")).replace("{name}",'<a href="/narrative'+e+'" onclick="'+d+'">'+(0,v.clean)(t)+"</a>")+'\n      </div>\n      <a href="#" class="link" onclick="window.Likes.share(\'narrative'+e+"'); return false;\">"+(0,n.getLang)("stories_manage_share_narrative")+"</a>\n    "},t.prototype.getSelectedStories=function(){var e=this;return this.state.selectedStoryIds.map((function(t){return e.props.storyMap[t]}))},t.prototype.componentWillUnmount=function(){this.revokeCustomUrls()},t.prototype.revokeCustomUrls=function(){var e=this.state.cover;e&&(0,w.isCustomCover)(e)&&[e.url,e.customPhotoOriginalUrl].forEach((function(e){(null==e?void 0:e.startsWith("blob:"))&&URL.revokeObjectURL(e)}))},t.defaultProps={name:"",type:a.EditorModeType.create,activeTabKey:a.EditorTabKey.selected,isEditingLinksAvailable:!1,appearance:a.EditorViewType.page},t}(i.Component)},887157:(e,t,r)=>{"use strict";var o,i,n,a;r.d(t,{EditorModeType:()=>o,EditorTabKey:()=>i,EditorViewType:()=>n,EditorSectionType:()=>a}),function(e){e[e.create=0]="create",e[e.edit=1]="edit"}(o||(o={})),function(e){e.all="all",e.selected="selected"}(i||(i={})),function(e){e.box="box",e.page="page"}(n||(n={})),function(e){e.main="main",e.cover="cover"}(a||(a={}))},888551:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorAllTab:()=>h});var o=r(570655),i=r(667294),n=r(887157),a=r(780528),s=r(98529),l=r(117173),c=r(659397),d=r(66433),u=r(439664),h=function(e){function t(t){var r=e.call(this,t)||this;return r.tabRef=i.createRef(),r.onScroll=function(){r.props.hasMore&&r.checkLoading()},r.checkLoading=(0,c.throttle)((function(){var e=r.props,t=e.loadMore,o=e.hasMore,i=r.state.isLoading,n=r.getScrollContainer(),a=r.getTabEl();o&&a&&(!i&&r.isMount&&(n instanceof HTMLElement?a.scrollTop+a.clientHeight>=a.scrollHeight-l.SCROLL_LOADING_MORE_GAP:window.innerHeight+l.SCROLL_LOADING_MORE_GAP>=a.getBoundingClientRect().bottom)&&(r.setState({isLoading:!0}),t().catch((function(e){console.error(e),(0,d.logError)(e)})).finally((function(){r.setState({isLoading:!1})}))))}),l.SCROLL_THROTTLE_DELAY),r.state={isLoading:!1},r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e,t=this,r=this.props,o=r.stories,n=r.selectedStoriesMap,l=r.className,d=r.onToggleCheck,h=r.isEditingLinksAvailable,v=r.onStoryLinkUpdate,_=r.linkData,p=this.state.isLoading;return i.createElement("div",{className:(0,c.classNames)("NarrativeEditorAllTab ScrollContainer",l),ref:this.tabRef},i.createElement(a.StoryArchivePreviewGrid,{className:"NarrativeEditorAllTab__grid"},o.map((function(r){var o=!1,a=new Date(1e3*r.time).toDateString();return e&&a===e||(e=a,o=!0),i.createElement("div",{className:"NarrativeEditorAllTab__story",key:r.rawId},i.createElement(s.StoryArchivePreview,{story:r,checked:!!n[r.id],selectable:t.isSelectable(r),onToggleCheck:d,onStoryLinkUpdate:v,isEditingLinksAvailable:h,linkData:_,needShowDate:o}))}))),p&&i.createElement("div",{className:"NarrativeEditorAllTab__loader"},i.createElement(u.default,null)))},t.prototype.isSelectable=function(e){var t=this.props.selectedStoriesMap,r=Object.keys(t).length;return!e.isUnavailable&&!!(r<l.MAX_NARRATIVE_STORIES||t[e.id])},t.prototype.componentDidMount=function(){this.isMount=!0,this.initScrollListener()},t.prototype.componentWillUnmount=function(){this.isMount=!1,this.deInitScrollContainer()},t.prototype.initScrollListener=function(){var e=this.getScrollContainer(),t=this.getTabEl();e&&t&&e.addEventListener("scroll",this.onScroll,!0)},t.prototype.deInitScrollContainer=function(){var e;null===(e=this.getScrollContainer())||void 0===e||e.removeEventListener("scroll",this.onScroll)},t.prototype.getScrollContainer=function(){return this.props.appearance===n.EditorViewType.box?this.getTabEl():window},t.prototype.getTabEl=function(){var e;return null===(e=this.tabRef)||void 0===e?void 0:e.current},t.defaultProps={isEditingLinksAvailable:!1,hasMore:!1},t}(i.Component)},495893:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorCoverSection:()=>b});var o=r(570655),i=r(667294),n=r(887157),a=r(659397),s=r(780528),l=r(98529),c=r(41650),d=r(288420),u=r(118690),h=r(405101),v=r(604192),_=r(49535),p=r(274123),g=r(111143),m=r(694292),f=r(673023),w=r(654612),y=r(241926),E=r(961540),S=r(66433),C=r(833623),N=r(303562),b=function(e){function t(t){var r,n=e.call(this,t)||this;n.scrollContainerRef=i.createRef(),n.isMount=!1,n.isCropSubmitted=!1,n.onFilesLoad=function(e){n.file=e[0],n.file&&n.uploadCover()},n.uploadCover=function(){if(n.file){var e=n.file,t=n.props.coverUploadConfig,r=new f.UploadPhoto(t,n.onUploadCoverProgress);r.validate(e).then((function(){if(n.isMount){var t=URL.createObjectURL(e),i={id:N.CustomCoverId,url:t,customPhotoOriginalUrl:t,percent:0,status:N.CoverUploadStatus.uploading};return n.setState({customCover:i}),r.upload(e).then((function(e){if(n.isMount){var t=JSON.stringify(e);n.setState({customCover:(0,o.__assign)((0,o.__assign)({},i),{percent:100,status:N.CoverUploadStatus.uploaded,uploadResponse:t}),checkedCoverId:N.CustomCoverId})}}))}})).catch((function(e){if(n.isMount){var t=n.state.customCover;t&&(t=(0,o.__assign)((0,o.__assign)({},t),{percent:0,status:N.CoverUploadStatus.failed})),console.error(e),e=(0,a.isObject)(e)?e.text:String(e),(0,w.showFastBox)((0,c.getLang)("global_error"),e||(0,c.getLang)("global_unknown_error")),(0,S.logError)(new Error("error with uploadCover"+(e?": "+e:""))),n.setState({customCover:t})}}))}},n.onUploadCoverProgress=function(e,t){var r=Math.min(e/t*100,90);n.setState((function(e){var t=e.customCover;return t?{customCover:(0,o.__assign)((0,o.__assign)({},t),{percent:r})}:null}))},n.selectCustomCover=function(){n.setState({checkedCoverId:N.CustomCoverId})},n.toggleCheck=function(e){n.setState({checkedCoverId:e.rawId})},n.openCropper=function(){var e=n.state.checkedCoverId,t=n.getCoverById(e);if(t){var r=n.getCoverOriginalUrl(t);r&&(0,E.loadImage)(r).then((function(e){if(n.isMount){var i=e.width,a=e.height,s=(0,o.__read)(n.getThumbSizes(i,a),2),l=s[0],c=s[1];n.setState({isModalOpen:!0}),(0,y.showNarrativeCropCoverBox)({coverUrl:r,coverHeight:a,coverWidth:i,thumbHeight:c,thumbWidth:l,crop:t.crop,onSave:n.onCropSave,onClose:n.onCropClose})}})).catch((function(e){console.error(e),e=String(e),(0,w.showFastBox)((0,c.getLang)("global_error"),e||(0,c.getLang)("global_unknown_error")),(0,S.logError)(new Error("error with cover openCropper"+(e?": "+e:"")))}))}},n.onCropSave=function(e,t){return n.saveCustomPhotoIfNeeded().then((function(r){n.isCropSubmitted=!0;var i=n.state.covers;(0,N.isSelectableCustomCover)(r)?n.setState({customCover:(0,o.__assign)((0,o.__assign)({},r),{url:t,crop:e})}):n.setState({covers:i.map((function(i){return i.id===r.id?(0,o.__assign)((0,o.__assign)({},r),{url:t,crop:e}):i}))})}))},n.onCropClose=function(){var e=n.props.onSave,t=n.state.checkedCoverId;n.setState({isModalOpen:!1});var r=n.getCoverById(t);r&&n.isCropSubmitted&&e({url:r.url,coverStoryId:r.coverStoryId,customPhotoOriginalUrl:r.customPhotoOriginalUrl,customPhotoId:r.customPhotoId,crop:r.crop})},n.getFooterButtons=function(){var e=n.props.onSave,t=n.state.customCover;return[i.createElement(d.default,{key:"close",appearance:"tertiary",onClick:function(){return e()}},(0,c.getLang)("global_cancel")),i.createElement(u.default,{key:"save",onClick:n.openCropper,disabled:(null==t?void 0:t.status)===N.CoverUploadStatus.uploading},(0,c.getLang)("stories_narrative_cover_next_step"))]},n.onDragEnter=function(e){var t,r,o,i;("file"===(null===(r=null===(t=null==e?void 0:e.dataTransfer)||void 0===t?void 0:t.items[0])||void 0===r?void 0:r.kind)||(null===(i=null===(o=null==e?void 0:e.dataTransfer)||void 0===o?void 0:o.types)||void 0===i?void 0:i.includes("Files")))&&(clearTimeout(n.dragLeaveTimeout),delete n.dragLeaveTimeout,n.setState({showDropArea:!0})),(0,_.cancelEvent)(e)},n.onDragLeave=function(e){clearTimeout(n.dragLeaveTimeout),n.dragLeaveTimeout=setTimeout((function(){delete n.dragLeaveTimeout,n.setState({showDropArea:!1})}),100),(0,_.cancelEvent)(e)},n.onDragDrop=function(e){var t,r;n.onDragLeave(e),(null===(r=null===(t=null==e?void 0:e.dataTransfer)||void 0===t?void 0:t.files)||void 0===r?void 0:r.length)&&n.onFilesLoad(Array.from(e.dataTransfer.files));var o=n.getScrollContainer();o&&o.scrollTo({top:0,behavior:"smooth"}),(0,_.cancelEvent)(e)};var s=(0,o.__read)(n.buildCovers(t),2),l=s[0],h=s[1],v=null===(r=l[0])||void 0===r?void 0:r.id;if(t.cover){var p=t.cover.customPhotoId,g=t.cover.coverStoryId;v=p?N.CustomCoverId:g?t.storyMap[g].rawId:t.stories[0].rawId}return n.state={showDropArea:!1,covers:l,customCover:h,checkedCoverId:v,isModalOpen:!1},n}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,r=t.className,o=t.appearance,d=t.stories,u=this.state,_=u.customCover,f=u.checkedCoverId,w=u.showDropArea,y=u.isModalOpen;return i.createElement(h.NarrativeEditorSection,{className:(0,a.classNames)("NarrativeEditorCoverSection",r),appearance:o,actionFooterButtons:this.getFooterButtons()},i.createElement("div",{className:"ScrollContainer",ref:this.scrollContainerRef},i.createElement("div",{className:"NarrativeEditorCoverSection__hint StoryGridHint"},(0,c.getLang)("stories_choose_cover_hint")),i.createElement(s.StoryArchivePreviewGrid,{className:"NarrativeEditorCoverSection__grid"},i.createElement("div",{className:"NarrativeEditorCoverSection__create"},i.createElement(v.StoryLoadFile,{text:(0,c.getLang)("stories_upload_narrative_cover"),onFilesLoad:this.onFilesLoad})),_&&i.createElement(m.StoryCustomCoverPreview,{uploadingStatus:_.status,coverUrl:_.customPhotoOriginalUrl,checked:_.id===f,uploadingPercent:_.percent,onToggleCheck:this.selectCustomCover,retryUpload:this.uploadCover}),d.map((function(t){return i.createElement("div",{className:"NarrativeEditorCoverSection__story",key:t.rawId},i.createElement(l.StoryArchivePreview,{story:t,checked:f===t.rawId,selectable:!0,onToggleCheck:e.toggleCheck}))})))),w&&!y&&o===n.EditorViewType.box&&i.createElement(p.UploadDropBoxArea,null),w&&!y&&o===n.EditorViewType.page&&i.createElement(g.UploadDropPageArea,null))},t.prototype.getThumbSizes=function(e,t){var r,o,i=e/t;return e>=t?(r=Math.min(e,C.MAX_THUMB_WIDTH),(o=Math.floor(r/i))>C.MAX_THUMB_HEIGHT&&(o=C.MAX_THUMB_HEIGHT,r=Math.floor(o*i))):(o=Math.min(t,C.MAX_THUMB_HEIGHT),(r=Math.floor(o*i))>C.MAX_THUMB_WIDTH&&(r=C.MAX_THUMB_WIDTH,o=Math.floor(r/i))),[r,o]},t.prototype.saveCustomPhotoIfNeeded=function(){var e=this,t=this.props,r=t.ownerId,i=t.coverUploadConfig,n=this.state.checkedCoverId,a=this.getCoverById(n);return a?(0,N.needSavePhoto)(a)?new Promise((function(t,n){window.ajax.post("al_stories.php",{act:"save_narrative_cover",owner_id:r,upload_response:a.uploadResponse,hash:i.hash},{onDone:function(r){var i=e.state.customCover;if(e.isMount&&i){var a=(0,o.__assign)((0,o.__assign)({},i),{customPhotoId:r});t(a)}else n()},onFail:function(e){return console.error(e),n(e),!0}})})):Promise.resolve(a):Promise.reject()},t.prototype.componentDidMount=function(){this.isMount=!0;var e=this.getDragAndDropContainer();e&&(e.addEventListener("drop",this.onDragDrop),e.addEventListener("dragenter",this.onDragEnter),e.addEventListener("dragover",this.onDragEnter),e.addEventListener("dragleave",this.onDragLeave))},t.prototype.componentWillUnmount=function(){this.isMount=!1,null!=this.dragLeaveTimeout&&clearTimeout(this.dragLeaveTimeout);var e=this.getDragAndDropContainer();e&&(e.removeEventListener("drop",this.onDragDrop),e.removeEventListener("dragenter",this.onDragEnter),e.removeEventListener("dragover",this.onDragEnter),e.removeEventListener("dragleave",this.onDragLeave))},t.prototype.getDragAndDropContainer=function(){return this.props.appearance===n.EditorViewType.box?window.boxLayerWrap:document.body},t.prototype.getScrollContainer=function(){return this.props.appearance===n.EditorViewType.box?this.scrollContainerRef.current:document.documentElement},t.prototype.buildCovers=function(e){var t,r=e.cover,i=e.stories;return r&&(0,N.isCustomCover)(r)&&(t=(0,o.__assign)({id:N.CustomCoverId},r)),[i.map((function(e){return(null==r?void 0:r.coverStoryId)===e.id?(0,o.__assign)({id:e.rawId},r):{id:e.rawId,url:e.preview,coverStoryId:e.id}})),t]},t.prototype.getCoverById=function(e){return e===N.CustomCoverId?this.state.customCover:this.state.covers.find((function(t){return t.id===e}))},t.prototype.getCoverOriginalUrl=function(e){var t,r=this.props.storyMap,o="";return(0,N.isSelectableCustomCover)(e)?o=e.customPhotoOriginalUrl:e.coverStoryId&&(o=null===(t=r[e.coverStoryId])||void 0===t?void 0:t.originalPreviewUrl),o},t}(i.Component)},303562:(e,t,r)=>{"use strict";var o;function i(e){return Boolean(e.customPhotoId||e.uploadResponse)}function n(e){return Boolean(e.customPhotoId)}function a(e){return e.uploadResponse&&!e.customPhotoId}function s(e){var t={url:e.coverUrl,crop:e.coverCrop};return e.customCover?(t.customPhotoId=e.customCover.photoId,t.customPhotoOriginalUrl=e.customCover.originalPhotoUrl):t.coverStoryId=e.coverStoryId,t}r.d(t,{CoverUploadStatus:()=>o,isSelectableCustomCover:()=>i,isCustomCover:()=>n,needSavePhoto:()=>a,getPreparedCover:()=>s,CustomCoverId:()=>l}),function(e){e[e.uploaded=0]="uploaded",e[e.uploading=1]="uploading",e[e.failed=2]="failed"}(o||(o={}));var l="custom"},956252:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorDataPanel:()=>h});var o=r(570655),i=r(667294),n=r(41650),a=r(659397),s=r(349062),l=r(117173),c=r(49535),d=r(726271),u=r(662199),h=function(e){function t(t){var r=e.call(this,t)||this;return r.getInputEl=function(){return r.nameInputRef&&r.nameInputRef.current},r.onKeyDown=function(e){e.keyCode===c.KEY.ENTER&&(e.ctrlKey||e.metaKey&&d.browser.mac)&&r.props.onSubmit()},r.nameInputRef=i.createRef(),r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.name,r=e.onNameChange,o=e.selectedStoriesCount,c=e.coverUrl,d=e.onCoverClick,h=e.className,v=0===o,_="";return v||(_=(0,n.getLang)("stories_choose_cover")),i.createElement("div",{className:(0,a.classNames)("NarrativeEditorDataPanel",h)},i.createElement("div",{className:"NarrativeEditorDataPanel__preview"},i.createElement(s.NarrativeItemPreviewCover,{className:(0,a.classNames)("NarrativeEditorDataPanel__cover",{"NarrativeEditorDataPanel__cover--active":!v}),onClick:d,cover:c,title:_,extra:!v&&i.createElement("div",{className:"NarrativeEditorDataPanel__pencil"},i.createElement(u.default,null))}),i.createElement("span",{className:(0,a.classNames)("NarrativeEditorDataPanel__name",{"NarrativeEditorDataPanel__name--empty":!t})},t||(0,n.getLang)("stories_narrative_name_full"))),i.createElement("div",{className:"NarrativeEditorDataPanel__form"},i.createElement("span",{className:"NarrativeEditorDataPanel__nameLabel"},(0,n.getLang)("stories_narrative_name")),i.createElement("input",{className:"NarrativeEditorDataPanel__nameInput",value:t,onChange:r,onKeyDown:this.onKeyDown,type:"text",placeholder:(0,n.getLang)("stories_enter_name"),maxLength:l.NARRATIVE_MAX_TITLE_LENGTH,ref:this.nameInputRef,autoFocus:!0}),o>0&&i.createElement("span",{className:"NarrativeEditorDataPanel__selectedStoryCount"},(0,n.getLang)("stories_selected_count",o))))},t}(i.Component)},743188:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorFooter:()=>a});var o=r(667294),i=r(483295),n=r(150382),a=function(e){var t=e.appearance,r=e.actionButtons;return o.createElement("div",{className:(0,i.classNames)("NarrativeEditorFooter","NarrativeEditorFooter--"+t)},o.createElement(n.ModalFooter,{actionButtons:r}))}},405101:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorSection:()=>s});var o=r(570655),i=r(667294),n=r(743188),a=r(483295),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scrollContainerRef=i.createRef(),t}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,r=e.children,o=e.appearance,s=e.actionFooterButtons;return i.createElement("div",{className:(0,a.classNames)("NarrativeEditorSection",t),ref:this.scrollContainerRef},i.createElement("div",{className:"NarrativeEditorSection__body"},r),Boolean(s)&&i.createElement(n.NarrativeEditorFooter,{appearance:o,actionButtons:s}))},t.prototype.getSectionEl=function(){var e;return null===(e=this.scrollContainerRef)||void 0===e?void 0:e.current},t}(i.Component)},417139:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorSelectedTab:()=>h});var o=r(570655),i=r(667294),n=r(887157),a=r(780528),s=r(98529),l=r(483295),c=r(117173),d=r(387142),u="NarrativeEditorSelectedTab__storyPreview",h=function(e){function t(t){var r=e.call(this,t)||this;return r.gridContainerRef=i.createRef(),r.tabRef=i.createRef(),r.state={draggingStoryRawId:""},r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.props,r=t.stories,o=t.selectedStoriesMap,n=t.className,c=t.isEditingLinksAvailable,d=t.onStoryLinkUpdate,h=t.linkData,v=t.onToggleCheck,_=this.state.draggingStoryRawId;return i.createElement("div",{className:(0,l.classNames)("NarrativeEditorSelectedTab ScrollContainer",n),ref:this.tabRef},i.createElement(a.StoryArchivePreviewGrid,{ref:this.gridContainerRef},r.map((function(t){return i.createElement("div",{className:"NarrativeEditorSelectedTab__story",key:t.rawId},i.createElement(s.StoryArchivePreview,{className:u,story:t,draggable:!0,isDragged:t.rawId===_,checked:!!o[t.id],selectable:e.isSelectable(t),onToggleCheck:v,onStoryLinkUpdate:d,isEditingLinksAvailable:c,linkData:h}))}))))},t.prototype.isSelectable=function(e){var t=this.props.selectedStoriesMap,r=Object.keys(t).length;return!e.isUnavailable&&!!(r<c.MAX_NARRATIVE_STORIES||t[e.rawId])},t.prototype.componentDidMount=function(){var e=this,t=this.props,r=t.onReorder,o=t.appearance,i=this.getGridContainer(),a={dragThreshold:0,onDragFinish:function(){e.setState({draggingStoryRawId:""})},onDragStart:function(t){var r=t.querySelector("."+u);if(r){var o=r.dataset.id;e.setState({draggingStoryRawId:o})}},onReorder:function(){var t=e.props.stories,o=document.querySelectorAll("."+u),i=[];o.forEach((function(e){var r=e.getAttribute("data-id"),o=t.find((function(e){return e.rawId===r}));o&&i.push(o.id)})),r(i)}};i&&(o===n.EditorViewType.box&&(a.wrapNode=this.getTabEl()),this.sorter=new d.default(i,"",a))},t.prototype.componentWillUnmount=function(){this.sorter&&this.sorter.destroy()},t.prototype.getTabEl=function(){var e;return null===(e=this.tabRef)||void 0===e?void 0:e.current},t.prototype.getGridContainer=function(){var e,t;return null===(t=null===(e=this.gridContainerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.getGridContainer()},t}(i.Component)},720516:(e,t,r)=>{"use strict";r.d(t,{NarrativeEditorStoriesTabPanel:()=>h});var o=r(570655),i=r(667294),n=r(887157),a=r(41650),s=r(641388),l=r(417139),c=r(888551),d=r(483295),u=r(117173),h=function(e){function t(t){var r=e.call(this,t)||this;return r.onTabClick=function(e,t){r.setState({tabKey:t,selectedTabStoryIds:(0,o.__spreadArray)([],(0,o.__read)(r.props.selectedStoryIds))})},r.onReorder=function(e){var t=r.props.onSelectedStoriesUpdate,o=r.getSelectedStoriesMap(),i=e.filter((function(e){return o[e]}));r.setState({selectedTabStoryIds:e}),t(i)},r.onStorySelectToggle=function(e){var t,i=r.props,a=i.selectedStoryIds,s=i.onSelectedStoriesUpdate,l=r.state,c=l.tabKey,d=l.selectedTabStoryIds,h=r.getSelectedStoriesMap();if(!(Object.keys(h).length>=u.MAX_NARRATIVE_STORIES)||h[e.id]){if(!d.length)return r.setState({selectedTabStoryIds:[e.id]}),void s([e.id]);if(h[e.id]){s(a.filter((function(t){return t!==e.id})))}else{var v=[],_=(0,o.__assign)((0,o.__assign)({},h),((t={})[e.id]=e,t));if(c===n.EditorTabKey.selected)v=d.filter((function(e){return _[e]}));else if(c===n.EditorTabKey.all){if(d.includes(e.id))v=d.filter((function(e){return _[e]}));else v=(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(d)),[e.id]).filter((function(e){return _[e]})),r.setState({selectedTabStoryIds:(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(d)),[e.id])})}s(v)}}},r.state={tabKey:t.selectedStoryIds.length?n.EditorTabKey.selected:n.EditorTabKey.all,selectedTabStoryIds:(0,o.__spreadArray)([],(0,o.__read)(t.selectedStoryIds))},r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,r=t.selectedStoryIds,o=t.appearance,u=t.isEditingLinksAvailable,h=t.linkData,v=t.onStoryLinkUpdate,_=t.loadMore,p=t.hasMore,g=this.state.tabKey,m=this.getSelectedStoriesMap(),f=this.getAllStories();return i.createElement("div",{className:"NarrativeEditorStoriesTabPanel"},i.createElement(s.default,{className:"NarrativeEditorStoriesTabPanel__tabs",onTabClick:this.onTabClick,active:g,disabledTabMap:(e={},e[n.EditorTabKey.selected]=!r.length,e)},i.createElement("span",{key:n.EditorTabKey.selected},(0,a.getLang)("stories_narrative_editor_selected_tab"),r.length>0&&i.createElement("span",{className:"Tabs__desc"},r.length)),i.createElement("span",{key:n.EditorTabKey.all},(0,a.getLang)("stories_narrative_editor_all_tab"))),g===n.EditorTabKey.selected&&i.createElement(l.NarrativeEditorSelectedTab,{className:(0,d.classNames)("NarrativeEditorSelectPanel__grid","NarrativeEditorSelectPanel__grid--"+o),appearance:o,stories:this.getSelectedTabStories(),onReorder:this.onReorder,onToggleCheck:this.onStorySelectToggle,selectedStoriesMap:m,onStoryLinkUpdate:v,isEditingLinksAvailable:u,linkData:h}),g===n.EditorTabKey.all&&i.createElement(c.NarrativeEditorAllTab,{className:(0,d.classNames)("NarrativeEditorSelectPanel__grid","NarrativeEditorSelectPanel__grid--"+o),appearance:o,stories:f,loadMore:_,hasMore:p,onToggleCheck:this.onStorySelectToggle,selectedStoriesMap:m,onStoryLinkUpdate:v,isEditingLinksAvailable:u,linkData:h}))},t.prototype.getSelectedTabStories=function(){var e=this;return this.state.selectedTabStoryIds.map((function(t){return e.props.storyMap[t]}))},t.prototype.getAllStories=function(){var e=this;return this.props.storyIds.map((function(t){return e.props.storyMap[t]}))},t.prototype.getSelectedStoriesMap=function(){var e=this;return this.props.selectedStoryIds.reduce((function(t,r){return t[r]=e.props.storyMap[r],t}),{})},t.defaultProps={isEditingLinksAvailable:!1},t}(i.Component)},349062:(e,t,r)=>{"use strict";r.d(t,{NarrativeItemPreviewCover:()=>n});var o=r(667294),i=r(483295),n=o.memo((function(e){var t=e.title,r=e.onClick,n=e.cover,a=e.href,s=e.className,l=void 0===s?"":s,c=e.extra,d=e.noBorder,u=void 0!==d&&d,h=e.isDraft,v=void 0!==h&&h,_=e.size,p=void 0===_?58:_,g=n?{backgroundImage:"url("+n+")"}:{},m=(0,i.classNames)("NarrativeItemPreviewCover","NarrativeItemPreviewCover--size"+p,l,{"NarrativeItemPreviewCover--noBorder":u,"NarrativeItemPreviewCover--isDraft":v}),f=o.createElement("div",{className:"NarrativeItemPreviewCover__image",style:g,title:t||void 0},c);return o.createElement(o.Fragment,null,a&&o.createElement("a",{href:a,className:m,onClick:r},f),!a&&o.createElement("div",{className:m,onClick:r},f))}))},109542:(e,t,r)=>{"use strict";r.d(t,{NarrativeRow:()=>c});var o=r(667294),i=r(349062),n=r(167625),a=r(659397),s=r(41650),l=r(521114),c=o.memo((function(e){var t,r,c,d,u=e.narrative,h=e.aside,v=e.onClick,_=e.className,p=e.clickable,g=e.size,m=e.noBorder,f=!u.storiesCount,w=f?"":"/narrative"+u.ownerId+"_"+u.id;return f?(t=o.createElement(i.NarrativeItemPreviewCover,{isDraft:!0,extra:o.createElement(l.default,null),size:g}),r=o.createElement(o.Fragment,null,(0,s.getLang)("groups_narrative_box_stories_count",u.storiesCount),o.createElement("span",{className:"dvd"}),o.createElement("span",null,(0,s.getLang)("stories_narratives_draft")))):(t=o.createElement(i.NarrativeItemPreviewCover,{onClick:v,size:g,cover:u.coverUrl,href:w,noBorder:m}),r=o.createElement("span",null,(0,s.getLang)("groups_narrative_box_stories_count",u.storiesCount))),p?c=v:f||(d=v),o.createElement("div",{className:(0,a.classNames)("NarrativeRow NarrativeListItem",_,{"NarrativeRow--clickable":p}),"data-id":u.id,onClick:c},o.createElement(n.NarrativeRowBase,{className:"NarrativeRow__inner",href:w,onClick:d,preview:t,id:u.id,title:u.title,subtitle:r,size:g,aside:h}))}))},167625:(e,t,r)=>{"use strict";r.d(t,{NarrativeRowBase:()=>s});var o=r(570655),i=r(667294),n=r(449849),a=r(659397),s=i.memo((function(e){e.id;var t,r=e.title,s=e.subtitle,l=e.preview,c=e.aside,d=e.href,u=e.onClick,h=e.className,v=void 0===h?"":h,_=e.size,p=void 0===_?58:_,g=(0,o.__rest)(e,["id","title","subtitle","preview","aside","href","onClick","className","size"]),m=Boolean(u||d);return r=(0,n.decodeHTMLEntities)(r),t=d?i.createElement("a",{href:d,className:"NarrativeRowBase__title",onClick:u},r):i.createElement("span",{className:"NarrativeRowBase__title",onClick:u},r),i.createElement("div",(0,o.__assign)({className:(0,a.classNames)("NarrativeRowBase","NarrativeRowBase--previewSize"+p,v,{"NarrativeRowBase--clickable":m})},g),i.createElement("div",{className:"NarrativeRowBase__preview"},l),i.createElement("div",{className:"NarrativeRowBase__inner"},i.createElement("div",{className:"NarrativeRowBase__main"},i.createElement("div",{className:"NarrativeRowBase__title"},t),s&&i.createElement("div",{className:"NarrativeRowBase__subtitle"},s)),c&&i.createElement("div",{className:"NarrativeRowBase__aside"},c)))}))},385597:(e,t,r)=>{"use strict";r.d(t,{NarrativeRowCreation:()=>c});var o=r(570655),i=r(667294),n=r(167625),a=r(41650),s=r(659397),l=r(587083),c=i.memo((function(e){var t=e.onClick,r=e.clickable,c=void 0!==r&&r,d=e.size,u=void 0===d?58:d,h=(0,a.getLang)("stories_create_new_narrative"),v=i.createElement("div",{className:(0,s.classNames)("NarrativeRowCreation__preview","NarrativeRowCreation__preview--size"+u)},i.createElement(l.default,null));return i.createElement("div",(0,o.__assign)({className:(0,s.classNames)("NarrativeRowCreation NarrativeListItem",{"NarrativeRowCreation--clickable":c})},{nodrag:"true"}),i.createElement(n.NarrativeRowBase,{className:"NarrativeRowCreation__inner",title:h,onClick:t,preview:v,size:u}))}))},551907:(e,t,r)=>{"use strict";r.d(t,{NarrativeSnippet:()=>a});var o=r(667294),i=r(41650),n=r(659397),a=function(e){var t=e.className,r=e.coverUrl,a=e.title,s=e.ownerName,l=e.storyCount;return o.createElement("div",{className:(0,n.classNames)("NarrativeSnippet",t)},o.createElement("div",{className:"NarrativeSnippet__inner"},o.createElement("div",{className:"NarrativeSnippet__cover"},o.createElement("div",{className:"NarrativeSnippet__image",style:{backgroundImage:"url("+r+")"}})),o.createElement("div",{className:"NarrativeSnippet__info"},o.createElement("div",{className:(0,n.classNames)("NarrativeSnippet__title",{"NarrativeSnippet__title--empty":!a})},a||(0,i.getLang)("stories_narrative_name_full")),o.createElement("span",{className:"NarrativeSnippet__author"},s),o.createElement("span",{className:"NarrativeSnippet__description"},o.createElement("span",null,(0,i.getLang)("global_type_narrative")),o.createElement("span",{className:"dvd"}),o.createElement("span",null,(0,i.getLang)("global_narrative_stories_count",l))))))}},98529:(e,t,r)=>{"use strict";r.d(t,{StoryArchivePreview:()=>v});var o=r(570655),i=r(667294),n=r(483295),a=r(41650),s=r(241926),l=r(66433),c=r(289988),d=r(213984),u=r(104022),h=r(439664),v=function(e){function t(t){var r=e.call(this,t)||this;return r.videoRef=i.createRef(),r.needPauseAfterLoading=!1,r.onLinkButtonClick=function(e){var t=r.props,o=t.story,i=t.onStoryLinkUpdate,n=t.linkData;t.isDragged||((0,s.showStoryLinkEditorBox)({story:o,onStoryLinkUpdate:i,linkData:n}),e.stopPropagation())},r.onMouseEnter=function(){r.setState({isHovered:!0})},r.onMouseLeave=function(){r.setState({isHovered:!1})},r.onToggleCheck=function(){var e=r.props,t=e.onToggleCheck,o=e.story;!e.isDragged&&t&&t(o)},r.state={isHovered:!1,preloadVideo:!1,canPlayVideo:!1,isLoading:!1},r}return(0,o.__extends)(t,e),t.prototype.componentDidUpdate=function(e,t){var r=this.props,o=r.story,i=r.isDragged,n=this.state.isHovered;o.videoUrl&&(i||(!t.isHovered&&n?this.playVideo():t.isHovered&&!n&&this.pauseVideo()),!e.isDragged&&i&&this.pauseVideo(),e.isDragged&&!i&&n&&this.playVideo())},t.prototype.componentWillUnmount=function(){this.cleanVideoPlayTimeout(),this.cleanVideoPauseTimeout(),this.cleanVideoLoaderTimeout()},t.prototype.playVideo=function(e){var t=this;void 0===e&&(e=!1),null!=this.videoPauseDelayTimeout&&this.cleanVideoPauseTimeout();var r=function(){delete t.videoPlayDelayTimeout,t.videoRef.current&&(t.videoRef.current.muted=!0,t.videoRef.current.play().then((function(){var e;if(t.hideLoader(),t.setState({canPlayVideo:!0}),t.needPauseAfterLoading)return null===(e=t.videoRef.current)||void 0===e||e.pause(),void(t.needPauseAfterLoading=!1)})).catch((function(e){t.hideLoader(),console.error(e),(0,l.logError)(e)})))};e?r():null==this.videoPlayDelayTimeout&&(this.videoLoaderTimeout=setTimeout((function(){t.setState({isLoading:!0})}),800),this.setState({preloadVideo:!0}),this.videoPlayDelayTimeout=setTimeout((function(){r()}),200))},t.prototype.pauseVideo=function(e){var t=this;void 0===e&&(e=!1),null!=this.videoPlayDelayTimeout&&this.cleanVideoPlayTimeout();var r=function(){var e;if(delete t.videoPauseDelayTimeout,t.hideLoader(),t.state.canPlayVideo){var r=null===(e=t.videoRef)||void 0===e?void 0:e.current;null==r||r.pause()}else t.needPauseAfterLoading=!0};e?r():null==this.videoPauseDelayTimeout&&(this.videoPauseDelayTimeout=setTimeout((function(){r()}),200))},t.prototype.cleanVideoPlayTimeout=function(){this.videoPlayDelayTimeout&&(clearTimeout(this.videoPlayDelayTimeout),delete this.videoPlayDelayTimeout)},t.prototype.cleanVideoPauseTimeout=function(){this.videoPauseDelayTimeout&&(clearTimeout(this.videoPauseDelayTimeout),delete this.videoPauseDelayTimeout)},t.prototype.cleanVideoLoaderTimeout=function(){this.videoLoaderTimeout&&(clearTimeout(this.videoLoaderTimeout),delete this.videoLoaderTimeout)},t.prototype.hideLoader=function(){this.state.isLoading&&this.setState({isLoading:!1}),this.cleanVideoLoaderTimeout()},t.prototype.render=function(){var e=this,t=this.props,r=t.story,o=t.checked,s=t.selectable,l=t.draggable,v=t.className,_=t.isEditingLinksAvailable,p=t.needShowDate,g=this.state,m=g.preloadVideo,f=g.canPlayVideo,w=g.isLoading,y=Boolean(r.videoUrl),E=new Date(1e3*r.time);return i.createElement("div",{className:(0,n.classNames)("StoryArchivePreview","StoryPreviewContainer",v,{"StoryArchivePreview--video":y,"StoryArchivePreview--checked":o}),onClick:this.onToggleCheck,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,"data-id":r.rawId},i.createElement("div",{className:"StoryArchivePreview__wrapper"},y&&i.createElement(i.Fragment,null,m&&i.createElement("video",{className:(0,n.classNames)("StoryArchivePreview__media",{"StoryArchivePreview__media--hidden":!f}),src:r.videoUrl,ref:this.videoRef,controls:!1,preload:"metadata",loop:!0,playsInline:!0}),!f&&i.createElement("img",{className:"StoryArchivePreview__media",src:r.preview,alt:""})),!y&&i.createElement("img",{className:"StoryArchivePreview__media",src:r.preview,alt:""}),p&&i.createElement("div",{className:"StoryArchivePreview__date"},i.createElement("div",{className:"StoryArchivePreview__day"},E.getDate()),i.createElement("div",{className:"StoryArchivePreview__month"},i.createElement(d.default,null,(0,a.getLang)("months_sm_of")[E.getMonth()+1]))),l&&!p&&i.createElement("div",{className:"StoryArchivePreview__draggableIcon"}),s&&i.createElement("div",{className:(0,n.classNames)("StoryArchivePreview__select",{"StoryArchivePreview__select--on":o})}),(_||r.videoUrl)&&i.createElement("div",{className:"StoryArchivePreview__footer"},i.createElement("div",{className:"StoryArchivePreview__footerInner"},r.videoUrl&&i.createElement("div",{className:"StoryArchivePreview__play"},i.createElement(u.default,null),i.createElement("span",{className:"StoryArchivePreview__playTime"},(0,c.formatTime)(r.duration))),_&&i.createElement("div",{className:"StoryArchivePreview__linkBtn",onClick:function(t){return e.onLinkButtonClick(t)}},r.linkUrl?(0,a.getLang)("stories_edit_link"):(0,a.getLang)("stories_add_link")))),w&&i.createElement("div",{className:"StoryArchivePreview__loader"},i.createElement(h.default,{size:24,strokeWidth:3,color:"#fff"}))))},t.defaultProps={checked:!1,selectable:!1,draggable:!1,isDragged:!1,className:"",isEditingLinksAvailable:!1,onToggleCheck:function(){},onStoryLinkUpdate:function(){},linkData:[]},t}(i.PureComponent)},780528:(e,t,r)=>{"use strict";r.d(t,{StoryArchivePreviewGrid:()=>a});var o=r(570655),i=r(667294),n=r(483295),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gridContainerRef=i.createRef(),t}return(0,o.__extends)(t,e),t.prototype.getGridContainer=function(){return this.gridContainerRef.current},t.prototype.render=function(){var e=this.props,t=e.className,r=e.children,o=e.isScrolling;return i.createElement("div",{className:(0,n.classNames)("StoryArchivePreviewGrid",t,{"StoryArchivePreviewGrid--scrolling":o})},i.createElement("div",{className:"StoryArchivePreviewGrid__inner",ref:this.gridContainerRef},r))},t.defaultProps={className:""},t}(i.Component)},694292:(e,t,r)=>{"use strict";r.d(t,{StoryCustomCoverPreview:()=>d});var o=r(570655),i=r(667294),n=r(659397),a=r(786427),s=r(410902),l=r(41650),c=r(303562),d=function(e){function t(t){return e.call(this,t)||this}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.checked,r=e.coverUrl,o=e.onToggleCheck,d=e.uploadingStatus,u=e.uploadingPercent,h=e.retryUpload,v=d===c.CoverUploadStatus.uploaded,_=d===c.CoverUploadStatus.uploading,p=d===c.CoverUploadStatus.failed,g=v;return i.createElement("div",{className:(0,n.classNames)("StoryCustomCoverPreview StoryPreviewContainer",{"StoryCustomCoverPreview--empty":_||p}),onClick:function(){g&&o()}},v&&i.createElement("div",{className:"StoryCustomCoverPreview__coverFrame"},i.createElement("div",{className:"StoryCustomCoverPreview__coverWrap"},i.createElement("img",{src:r,className:"StoryCustomCoverPreview__cover",alt:""}))),_&&i.createElement(a.StoryProgressSpinner,{percent:u}),p&&i.createElement(i.Fragment,null,i.createElement(s.default,null),i.createElement("span",{className:"StoryCustomCoverPreview__errorText"},(0,l.getLang)("stories_upload_error_text")),i.createElement("div",{className:"StoryCustomCoverPreview__repeat",onClick:h},(0,l.getLang)("stories_upload_repeat"))),g&&i.createElement("div",{className:(0,n.classNames)("StoryCustomCoverPreview__select",{"StoryCustomCoverPreview__select--on":t})}))},t.defaultProps={uploadingStatus:c.CoverUploadStatus.uploaded},t}(i.PureComponent)},730095:(e,t,r)=>{"use strict";r.d(t,{StoryLinkEditorBox:()=>f});var o=r(570655),i=r(667294),n=r(41650),a=r(288420),s=r(41929),l=r(494538),c=r(156589),d=r(870078),u=r(695724),h=r(654612),v=r(386409),_=r(66433),p=r(118690),g=r(486125),m=r(961540),f=function(e){function t(t){var r=e.call(this,t)||this;return r.inputRef=i.createRef(),r.needCleanLink=!1,r.onChangeLink=function(e){var t=(0,u.trim)(e.target.value);r.needCleanLink&&(r.needCleanLink=!1,t=r.cleanLink(t)||t),r.setState({link:t,needShowHint:!r.isLinkValid(t)})},r.onKeyUpLink=function(){var e=r.state.link;r.setState({needShowHint:!r.isLinkValid(e)})},r.onPasteLink=function(){r.needCleanLink=!0},r.onChangeLinkType=function(e){r.setState({linkType:String(e.selected.value)})},r.onSave=function(){var e,t,o,i,a=r.props.linkData,s=r.state.linkType,l=r.state.link;if(l=(0,u.trim)(l),!r.isLinkValid(l))return null===(t=null===(e=r.inputRef)||void 0===e?void 0:e.current)||void 0===t||t.focus(),null===(i=null===(o=r.inputRef)||void 0===o?void 0:o.current)||void 0===i||i.notaBene(),void r.setState({needShowHint:!0});var c=l?"https://"+(0,m.getHostName)()+"/"+l:"";a.needShowHint?(0,h.showFastBox)((0,n.getLang)("stories_saving_link"),(0,n.getLang)("stories_link_editing_warning"),(0,n.getLang)("global_save"),(function(e){r.edit(c,s,!0,e)}),(0,n.getLang)("global_cancel")):r.edit(c,s)},r.onDelete=function(){r.props.linkData.needShowHint?(0,h.showFastBox)((0,n.getLang)("stories_deleting_link"),(0,n.getLang)("stories_link_deleting_warning"),(0,n.getLang)("global_delete"),(function(e){r.delete(e)}),(0,n.getLang)("global_cancel")):r.delete()},r.state={link:t.story.linkUrl?r.cleanLink(t.story.linkUrl):"",linkType:t.story.linkType||t.linkData.items[0].value,needShowHint:!1,isSaving:!1,isDeleting:!1},r}return(0,o.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,r=e.linkData,o=this.state,a=o.linkType,u=o.link,h=o.needShowHint,v=this.isEditMode()?(0,n.getLang)("stories_edit_link_title"):(0,n.getLang)("stories_add_link_title");return i.createElement(s.BoxModal,{className:"StoryLinkEditorBox",appearance:"blue",onClose:t,title:v,actionButtons:this.getActionButtons(),hasScroll:!1},i.createElement("div",{className:"StoryLinkEditorBox__inner"},i.createElement("div",{className:"StoryLinkEditorBox__row"},i.createElement("span",{className:"StoryLinkEditorBox__label"},(0,n.getLang)("stories_link_label_url")),i.createElement("div",{className:"StoryLinkEditorBox__control"},i.createElement(d.StoryLinkHint,{open:h,text:(0,n.getLang)("stories_upload_link_format")},i.createElement("div",{className:"StoryLinkHint__input"},i.createElement(l.InputWithPrefix,{className:"StoryLinkEditorBox__input",prefix:"https://"+(0,m.getHostName)()+"/",value:u,onChange:this.onChangeLink,onKeyUp:this.onKeyUpLink,onPaste:this.onPasteLink,autoFocus:!0,ref:this.inputRef}))))),i.createElement("div",{className:"StoryLinkEditorBox__row"},i.createElement("span",{className:"StoryLinkEditorBox__label"},(0,n.getLang)("stories_link_label_text")),i.createElement("div",{className:"StoryLinkEditorBox__control"},i.createElement(c.default,{className:"StoryLinkEditorBox__select",appearance:"secondary",options:r.items,value:a,onChange:this.onChangeLinkType})))))},t.prototype.isEditMode=function(){return Boolean(this.props.story.linkUrl)},t.prototype.isLinkValid=function(e){return Boolean(e)&&e.length>=2&&Boolean(e.match(/^[a-z0-9\/\-._%=?&@#]+$/i))&&!decodeURIComponent(e).match(/away.php/)},t.prototype.cleanLink=function(e){var t=(e=(0,u.trim)(e)).match(/[https?:\/\/]*((?:[a-z0-9_\-]+\.)+(?:[a-z]{2,9})\/)(.*?)?(\#.*?)?(?:[\.!:;,\*\(\)&]*&nbsp;|[ \t\r\n \u00A0]|$)/i);return(t&&t[2]?t[2]:"")+(t&&t[3]?t[3]:"")},t.prototype.edit=function(e,t,r,o){var i=this;void 0===e&&(e=""),void 0===t&&(t=""),void 0===r&&(r=!0);var a=this.props,s=a.onStoryLinkUpdate,l=a.onClose,c=a.story,d=a.linkData;window.ajax.post("al_stories.php",{act:"edit_link",story_raw_id:c.rawId,link_url:e,link_text:t,hash:d.editHash},{onDone:function(){l(),s(c.rawId,e,t)},onFail:function(e){(0,g.showDoneBox)(e||(0,n.getLang)("global_unknown_error"));var t="Link saving error in StoryLinkEditor"+(e?": "+e:"");return(0,_.logError)(new Error(t)),!0},showProgress:function(){r?i.setState({isSaving:!0}):i.setState({isDeleting:!0}),(0,v.lockButton)(o)},hideProgress:function(){var e;o&&(null===(e=(0,g.curBox)())||void 0===e||e.hide(),(0,v.unlockButton)(o)),r?i.setState({isSaving:!1}):i.setState({isDeleting:!1})}})},t.prototype.delete=function(e){this.edit("","",!1,e)},t.prototype.getActionButtons=function(){var e=this.props.onClose,t=this.state,r=t.isSaving,o=t.isDeleting,s=[i.createElement(a.default,{key:"close",appearance:"tertiary",onClick:function(){return e()}},(0,n.getLang)("global_cancel")),i.createElement(p.default,{loading:r,key:"save",appearance:"primary",onClick:this.onSave},this.isEditMode()?(0,n.getLang)("global_save"):(0,n.getLang)("stories_add_link"))];return this.isEditMode()&&s.unshift(i.createElement(p.default,{loading:o,appearance:"link",key:"delete",className:"StoryLinkEditorBox__extraFooterBtn",onClick:this.onDelete},(0,n.getLang)("stories_delete_link"))),s},t}(i.Component)},870078:(e,t,r)=>{"use strict";r.d(t,{StoryLinkHint:()=>n});var o=r(667294),i=r(814217),n=function(e){var t=e.text,r=e.children,n=e.open,a=void 0!==n&&n,s=o.createElement("div",{className:"StoryLinkHint"},o.createElement("div",{className:"StoryLinkHint__inner"},t));return o.createElement(i.Popper,{open:a,position:"t",align:"left",content:s},r)}},604192:(e,t,r)=>{"use strict";r.d(t,{StoryLoadFile:()=>n});var o=r(667294),i=r(488124),n=function(e){var t=e.text,r=e.multiple,n=void 0!==r&&r,a=e.onFilesLoad;return o.createElement("div",{className:"StoryLoadFile StoryPreviewContainer"},o.createElement(i.default,null),o.createElement("span",{className:"StoryLoadFile__text"},t),o.createElement("input",{type:"file",className:"StoryLoadFile__input",multiple:n,onChange:function(e){var t=e.currentTarget.files;t&&a(Array.from(t))}}))}},786427:(e,t,r)=>{"use strict";r.d(t,{StoryProgressSpinner:()=>a});var o=r(667294),i=3,n=2*Math.PI*22,a=o.memo((function(e){var t=e.percent,r=void 0===t?60:t,a=e.width,s=void 0===a?24:a,l=e.height,c=void 0===l?24:l,d=(n-i)*r/100+i;return o.createElement("svg",{className:"StoryProgressSpinner",width:s,height:c,viewBox:"0 0 50 50"},o.createElement("circle",{cx:"25",cy:"25",r:22,stroke:"#fff",fill:"none",strokeWidth:"6",strokeMiterlimit:"10",strokeDashoffset:"0",strokeDasharray:d+","+n,strokeLinecap:"round"}))}))},274123:(e,t,r)=>{"use strict";r.d(t,{UploadDropBoxArea:()=>n});var o=r(667294),i=r(41650),n=function(){return o.createElement("div",{className:"UploadDropBoxArea"},o.createElement("div",{className:"UploadDropBoxArea__inner"},o.createElement("div",{className:"UploadDropBoxArea__text"},(0,i.getLang)("stories_narrative_cover_drop_hint"))))}},111143:(e,t,r)=>{"use strict";r.d(t,{UploadDropPageArea:()=>a});var o=r(667294),i=r(41650),n=r(394021),a=function(){return o.createElement(n.WithPortal,null,o.createElement("div",{className:"UploadDropPageArea"},o.createElement("div",{className:"UploadDropPageArea__inner"},o.createElement("div",{className:"UploadDropPageArea__image"}),o.createElement("div",{className:"UploadDropPageArea__text"},(0,i.getLang)("stories_drop_page_area_label")))))}},117173:(e,t,r)=>{"use strict";r.d(t,{STORIES_MANAGE_MODULE:()=>o,LONG_PRESS_DELAY_MS:()=>i,StickerTypes:()=>n,EMOJI_REACTIONS_ARR:()=>a,QUESTION_SELECT_MODE:()=>s,MAX_FEEDBACK_STORIES_SLICE_COUNT:()=>l,INIT_MAX_FEEDBACK_STORIES_COUNT:()=>c,MAX_NARRATIVE_STORIES:()=>d,NARRATIVE_MAX_TITLE_LENGTH:()=>u,BOX_ITEM_DRAGGABLE_CLASS:()=>h,SCROLL_THROTTLE_DELAY:()=>v,SCROLL_LOADING_MORE_GAP:()=>_});var o="stories_manage",i=200,n={hashtag:1,mention:2,question:3,place:4,music:5,storyReply:6,owner:7,link:8,marketItem:9,post:10,poll:11,sticker:12,app:13,situationalTheme:14},a=[{code:"f09f9882",name:"face_with_tears_of_happiness"},{code:"f09f988d",name:"smiling_face_with_heart_eyes"},{code:"f09f918df09f8fbf",name:"thumbs_up"},{code:"f09f98ad",name:"loud_crying_face"},{code:"f09f98b1",name:"face_screaming_in_fear"},{code:"e298ba",name:"smiling_face"}],s={PUBLIC:0,AUTHOR_ONLY:1,ANONYMOUS:3},l=50,c=10,d=100,u=23,h="NarrativeBox__draggable",v=34,_=400},652745:(e,t,r)=>{"use strict";r.d(t,{prepareStoriesForPublishing:()=>v,updateNarrativeBlock:()=>_,highlightNarrativeBlock:()=>p,updateNarrativeSnippetsFromQueueByPost:()=>g});var o=r(315544),i=r(486125),n=r(560717),a=r(786067),s=r(40906),l=r(814200),c=r(856901),d=r(533228),u=r(66433),h=r(19331);function v(e){return e.map((function(e){return e.id})).join(",")}function _(e){void 0===e&&(e=!1);var t=(0,s.intval)(window.cur.oid);if(window.cur.narrativeBlock)window.ajax.post("al_stories.php",{act:"get_narrative_block",owner_id:t},{onDone:function(e){var t=(0,s.intval)(window.cur.oid),r=document.getElementById("narratives_module"+t+"_wrapper");if(r)if(e)(0,o.domReplaceEl)(r,e),window.cur.narrativeBlock&&window.cur.narrativeBlock.destroy(),window.NarrativeBlock&&(window.cur.narrativeBlock=new l.default);else{var i=r.parentElement;(null==i?void 0:i.children.length)&&(null==i?void 0:i.children.length)>1?r.remove():null==i||i.remove(),window.cur.narrativeBlock&&window.cur.narrativeBlock.destroy(),delete window.cur.narrativeBlock}(0,d.removeStoryList)("narratives"+t)}});else if(t>0&&"profile"===window.cur.module){var r=document.getElementById(c.PROFILE_MEDIA_NARROW_BLOCK_ID),n=!r;window.ajax.post("al_stories.php",{act:"get_narrative_block",owner_id:t,need_wrap_block:(0,s.intval)(n)},{onDone:function(e){if(r)r.insertAdjacentHTML("afterbegin",e);else{var o=document.getElementById("narrow_column");if(!o)return;o.insertAdjacentHTML("beforeend",e)}window.cur.narrativeBlock&&window.cur.narrativeBlock.destroy(),window.NarrativeBlock&&(window.cur.narrativeBlock=new l.default,window.cur.narrativeBlock.showOnboardTooltipIfNeeded()),(0,d.removeStoryList)("narratives"+t)}})}else e&&function(e){window.boxQueue.hideAll();var t=document.querySelector("#box_layer_wrap"),r=document.querySelector("#box_loader");window.nav.reload({onDone:function(){e&&e()},showProgress:function(){(0,o.show)(t),(0,o.show)(r),(0,i.boxRefreshCoords)(r)},hideProgress:function(){(0,o.hide)(t),(0,o.hide)(r)}})}((function(){window.cur.needNarrativeOnboard=!0}))}function p(e){if(e){var t="narratives_module"+window.vk.id;(0,n.highlightModule)({module:t,text:(0,a.getLang)("stories_narrative_block_onboarding_text"),onClose:function(){delete window.cur.needNarrativeOnboard,window.ajax.post("al_index.php",{act:"hide_feature_tt",hash:e,type:"profile_narrative"})},autoCancelDelay:1e4,speed:600})}}function g(e){if(window.vk.id&&(0,h.partConfigEnabled)("update_private_snippets_by_queue")){var t=Array.from(e.querySelectorAll(".NarrativeSnippet"));if(t.length){var r=[];t.forEach((function(e){if(window.vk.id&&e.dataset.needUpdate){var t=e.dataset.narrativeRawId;t&&r.push({narrative_raw_id:t,snippet_type:e.dataset.snippetType,from:e.dataset.from})}})),r.length&&window.ajax.post("al_stories.php",{act:"get_narrative_snippets",narrative_snippets:JSON.stringify(r)},{onDone:function(e){t.forEach((function(t){t.dataset.narrativeRawId&&e[t.dataset.narrativeRawId]&&(t.outerHTML=e[t.dataset.narrativeRawId])}))},onFail:function(){return(0,u.logError)(new Error("Fail: updateNarrativeSnippetFromQueueByPost")),!0}})}}}},241926:(e,t,r)=>{"use strict";r.d(t,{showNarrativeEditorBox:()=>C,showNarrativeBox:()=>N,showRecommendedNarrativesBox:()=>b,loadRecommendedNarrativesBoxData:()=>k,showNarrativeChooseBox:()=>L,showNarrativeCreateLiteBox:()=>T,showStoryLinkEditorBox:()=>B,showNarrativeCropCoverBox:()=>x});var o=r(570655),i=r(667294),n=r(887157),a=r(449849),s=r(481117),l=r(115985),c=r(709652),d=r(486125),u=r(786067),h=r(386409),v=r(654612),_=r(744451),p=r(884215),g=r(730095),m=r(66433),f=r(111898),w=r(849464),y=r(833623),E=r(303562),S=560;function C(e,t){void 0===t&&(t={});var r={},l=t.narrative,c=t.onClose,h=t.onSave,v=t.navScreen,_=t.stories,p=t.selectedStories,g=void 0===p?[]:p,w=t.publishHash,y=t.editHash,S=t.linkData,C=t.isEditingLinksAvailable,N=t.storiesCount,b=t.coverUploadConfig,k=t.getPublishDoneHTML,I=!1;function L(){window.stManager.add(["NarrativeEditor.css"]).then((function(){r.box=(0,s.showComponentInBox)(P(),{width:638,onDestroy:function(e){(0,s.destroyComponentInBox)(e),c&&c(I)}})})).catch((function(e){console.error(e),(0,m.logError)(e)}))}function T(){return(null==_?void 0:_.length)?new Promise((function(t,r){if(!(null==_?void 0:_.length))return r("empty stories");window.ajax.post("al_stories.php",{act:"get_archive_stories",owner_id:e,offset:_.length},{onDone:function(e,i){if(_){_=(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(_)),(0,o.__read)(e));var n=(N=i)>_.length;t(n),A()}else r("empty stories after loading")},onFail:function(e){return r(e),!0}})})):Promise.reject("empty stories")}function B(e){I=!0,h&&h(e)}function x(e){r.box&&r.box.hide(),e&&e()}function A(){(null==_?void 0:_.length)&&w&&y&&(0,s.updateCurrentComponentInBox)(P())}function D(e,t,r){if(null==_?void 0:_.length){var i=function(i){return null==i?void 0:i.map((function(i){return i.rawId===e?(0,o.__assign)((0,o.__assign)({},i),{linkUrl:t,linkType:r}):i}))};_=i(_),g=i(g)||[],A()}}function P(){if((null==_?void 0:_.length)&&w&&y&&N&&b){var t=_.reduce((function(e,t){return e[t.id]=t,e}),{});t=g.reduce((function(e,t){return e[t.id]=t,e}),t);var r=_.map((function(e){return e.id})),o=g.map((function(e){return e.id})),s=l?n.EditorModeType.edit:n.EditorModeType.create,c=(null==l?void 0:l.title)?(0,a.decodeHTMLEntities)(l.title):"",d=N>_.length,u=l?(0,E.getPreparedCover)(l):void 0;return i.createElement(f.NarrativeEditor,{ownerId:e,type:s,name:c,narrativeRawId:null==l?void 0:l.rawId,cover:u,selectedStoryIds:o,storyIds:r,hasMore:d,storyMap:t,close:x,loadMore:T,onSave:B,publishHash:w,editHash:y,linkData:S,isEditingLinksAvailable:C,onStoryLinkUpdate:D,appearance:n.EditorViewType.box,navScreen:v,coverUploadConfig:b,getPublishDoneHTML:k})}}_&&w&&y&&N&&b?L():new Promise((function(t,r){window.ajax.post("al_stories.php",{act:"get_narrative_editor_data",owner_id:e},{loader:!0,onDone:function(e){_=e.stories,N=e.storiesCount,w=e.publishHash,y=e.editHash,S=e.linkData,C=e.isEditingLinksAvailable,b=e.coverUploadConfig,t([_,N,w,y,S,C,b])},onFail:function(e){return r(e),!0}})})).then((function(){L()})).catch((function(e){(0,d.showDoneBox)(e||(0,u.getLang)("global_error")),(0,m.logError)(e)}))}function N(e){var t=e.ownerId,r=e.onClose,n=e.onSave,a=e.onRemove,_=e.onReorder,p=e.navScreen,g={narratives:[],ownerId:t,boxAct:"get_narrative_box_data"},m=!1;function f(){return D(g).then((function(){y()})).catch((function(e){(0,d.showDoneBox)(e||(0,u.getLang)("global_error"))}))}function y(){if(g.boxData){var e=g.boxData.canEdit?c.BoxType.edit:c.BoxType.view;(0,s.updateCurrentComponentInBox)(i.createElement(l.NarrativeBox,{type:e,boxData:g.boxData,narratives:g.narratives,onClose:b,onSave:E,onRemove:C,onBookmark:I,onReorder:k,loadMore:f,navScreen:p}))}}function E(e){n&&n(e),m=!0}function C(e){var t,r,o;t=e,r={title:(0,u.getLang)("global_warning")},o=function(e){var r=g.boxData;r&&window.ajax.post("al_stories.php",{act:"remove_narrative",narrative_raw:t.rawId,hash:r.removeHash},{onDone:function(){r.count-=1,(0,w.sendNarrativeAnalytic)(w.NarrativeAnalyticEventType.deleteNarrative,t,p),g.narratives=g.narratives.filter((function(e){return e.rawId!==t.rawId})),y(),(0,d.showDoneBox)((0,u.getLang)("stories_deleted_narrative")),a&&a()},onFail:function(e){return(0,d.showDoneBox)(e||(0,u.getLang)("global_error")),!0},showProgress:function(){return(0,h.lockButton)(e)},hideProgress:function(){(0,d.curBox)().hide(),(0,h.unlockButton)(e)}})},(0,v.showFastBox)(r,(0,u.getLang)("stories_narrative_remove_warning"),(0,u.getLang)("stories_remove_confirm"),o,(0,u.getLang)("global_cancel"))}function N(){m&&b()}function b(){g.box&&g.box.hide()}function k(e){g.narratives=e,y(),_&&_()}function I(e){e.isBookmarked=!e.isBookmarked,y()}A(g).then((function(e){var t=(0,o.__read)(e,3),n=t[0],a=t[1],d=t[2];g.narratives=n,g.boxData=a,g.startFrom=d,g.box=function(e,t){var o=t.canEdit?c.BoxType.edit:c.BoxType.view;return(0,s.showComponentInBox)(i.createElement(l.NarrativeBox,{type:o,boxData:t,narratives:e,loadMore:f,onClose:b,onSave:E,onReorder:k,onBookmark:I,onRemove:C,navScreen:p}),{width:S,onShow:N,onDestroy:function(e){(0,s.destroyComponentInBox)(e),r&&r()}})}(n,a)})).catch((function(e){(0,d.showDoneBox)(e||(0,u.getLang)("global_error")),r&&r()}))}function b(e){var t;void 0===e&&(e={});var r=I(e);function n(){return D(r).then((function(){c()})).catch((function(e){(0,d.showDoneBox)(e||(0,u.getLang)("global_error"))}))}function a(){return(0,s.showComponentInBox)(h(),{width:S,onDestroy:function(e){(0,s.destroyComponentInBox)(e)}})}function c(){r.boxData&&(0,s.updateCurrentComponentInBox)(h())}function h(){if(r.boxData)return i.createElement(l.NarrativeBox,{title:(0,u.getLang)("news_fb_block_recommend_narratives"),showNarrativeNumber:!1,boxData:r.boxData,narratives:r.narratives,loadMore:n,onClose:v,onBookmark:_,trackCode:r.trackCode,list:r.list,source:r.source})}function v(){r.box&&r.box.hide()}function _(e){e.isBookmarked=!e.isBookmarked,c()}(null===(t=r.narratives)||void 0===t?void 0:t.length)&&r.boxData?r.box=a():A(r).then((function(e){var t=(0,o.__read)(e,2),i=t[0],n=t[1];r.narratives=i,r.boxData=n,r.box=a()})).catch((function(e){(0,d.showDoneBox)(e||(0,u.getLang)("global_error"))}))}function k(e){return void 0===e&&(e={}),A(I(e),!0)}function I(e){return void 0===e&&(e={}),{narratives:e.narratives?e.narratives:[],boxData:e.boxData,boxAct:"get_recommended_narratives",trackCode:e.trackCode,list:e.list,source:e.source}}function L(e){var t=e.ownerId,r=e.story,n=e.onClose,a=e.onSave,l=e.navScreen,c={narratives:[],ownerId:t,boxAct:"get_narrative_choose_box_data"},h=!1;function v(){return D(c).then((function(e){return function(){if(!c.boxData)return;(0,s.updateCurrentComponentInBox)(i.createElement(_.NarrativeChooseBox,{story:r,narratives:c.narratives,onClose:m,onSave:p,boxData:c.boxData,loadMore:v,navScreen:l}))}(),e})).catch((function(e){return(0,d.showDoneBox)(e||(0,u.getLang)("global_error")),[]}))}function p(e){h=!0,a&&a(e)}function g(){h&&m()}function m(){c.box&&c.box.hide()}A(c).then((function(e){var t=(0,o.__read)(e,3),a=t[0],d=t[1],u=t[2];c.narratives=a,c.boxData=d,c.startFrom=u,c.box=function(e,t){return(0,s.showComponentInBox)(i.createElement(_.NarrativeChooseBox,{story:r,narratives:e,boxData:t,loadMore:v,onClose:m,onSave:p,navScreen:l}),{width:S,onShow:g,onDestroy:function(e){(0,s.destroyComponentInBox)(e),n&&n(h)}})}(a,d)})).catch((function(e){(0,d.showDoneBox)(e||(0,u.getLang)("global_error")),n&&n()}))}function T(e){var t=e.onSave,r=e.onClose,o=e.ownerId,n=e.ownerName,a=e.stories,l=e.publishNarrativeHash,c=(0,s.showComponentInBox)(i.createElement(p.NarrativeCreateLiteBox,{stories:a,ownerId:o,ownerName:n,publishNarrativeHash:l,onSave:t,onClose:function(){c&&c.hide()}}),{width:S,onDestroy:function(e){(0,s.destroyComponentInBox)(e),r&&r()}})}function B(e){var t=e.story,r=e.onClose,n=e.onStoryLinkUpdate,a=e.linkData;t.linkType&&t.linkText&&(a.items.find((function(e){return e.value===t.linkType}))||(a=(0,o.__assign)((0,o.__assign)({},a),{items:(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(a.items)),[{value:t.linkType,label:t.linkText}])})));var l=(0,s.showComponentInBox)(i.createElement(g.StoryLinkEditorBox,{story:t,onClose:function(){l&&l.hide()},onStoryLinkUpdate:n,linkData:a}),{width:450,onDestroy:function(e){(0,s.destroyComponentInBox)(e),r&&r()}})}function x(e){var t=e.coverUrl,r=e.coverHeight,o=e.coverWidth,n=e.thumbHeight,a=e.thumbWidth,l=e.onClose,c=e.onSave,d=e.crop,u=(0,s.showComponentInBox)(i.createElement(y.NarrativeCoverCropper,{coverUrl:t,coverHeight:r,coverWidth:o,thumbHeight:n,thumbWidth:a,onClose:function(){u&&u.hide()},onSave:c,crop:d}),{width:638,onDestroy:function(e){(0,s.destroyComponentInBox)(e),l&&l()}})}function A(e,t){return void 0===t&&(t=!1),new Promise((function(r,o){window.ajax.post("al_stories.php",{act:e.boxAct,owner_id:e.ownerId,start_from:e.startFrom,track_code:e.trackCode},{loader:!e.narratives.length&&!t,onDone:function(e,t,o){r([e,t,o])},onFail:function(e){return o(e),!0}})}))}function D(e){return A(e).then((function(t){var r,i=(0,o.__read)(t,3),n=i[0],a=i[2];return e.narratives=(null===(r=e.narratives)||void 0===r?void 0:r.concat(n))||n,e.startFrom=a,n}))}},125696:(e,t,r)=>{"use strict";r.d(t,{addLayer:()=>v,removeLayer:()=>_,layerShown:()=>p,layerHide:()=>g,hideAllLayers:()=>m,getFirstLayer:()=>f,getPrevLayer:()=>w,slicePrevLayers:()=>y,onReplyDeleted:()=>E,checkAndPrepareBoxQueue:()=>C,isOpeningLocked:()=>N});var o=r(475632),i=r(49535),n=r(315544),a=r(486125),s=[],l=!1,c=function(){window.cur.storyLayer&&window.cur.storyLayer.onVisibilityChange()},d=function(){window.cur.storyLayer&&window.cur.storyLayer.onResize()},u=function(e){window.cur.storyLayer&&window.cur.storyLayer.onKeyDown(e)},h=function(e){window.cur.storyLayer&&window.cur.storyLayer.onKeyUp(e)};function v(e,t){window.cur.storyLayer&&window.cur.storyLayer.pauseLayer(),(0,n.ge)("stories_layers_background")||(document.body.appendChild((0,n.ce)("div",{id:"stories_layers_background",className:"stories_layers_background"})),window.layerQueue.hide(),window.layerQueue.push(),window.layers.fullhide=m,(0,i.addEvent)(window,"visibilitychange",c,void 0,void 0,!0),(0,i.addEvent)(window,"resize",d),(0,i.addEvent)(document,"keydown",u),(0,i.addEvent)(document,"keyup",h)),window.cur.storyLayer=e,l=!0,e.animateStory("expand",t.fromEl).catch((function(){})).finally((function(){l=!1})),s.push(e),(0,n.addClass)(document.body,"stories_layer_shown"),(0,o.cancelStackPush)("stories_layer_close"+s.length,(function(t){void 0===t&&(t={}),t.byTimer?e.sendNavigationStatEvents("close_auto_by_time"):e.sendNavigationStatEvents("close_tap"),s.length>1&&!t.isCloseBtnClick?e.back():(e.hideAllLayers=t.isCloseBtnClick,e.hide(!1))}))}function _(){var e;s.pop(),window.cur.storyLayer=s[s.length-1],window.cur.storyLayer?window.cur.storyLayer.resumeLayer():(m(!0),window.layerQueue.pop(),window.cur.storiesCashedBoxQueueData&&((0,a.restoreBoxQueue)(window.cur.storiesCashedBoxQueueData),(e=S())&&(e.forceHide=!1,e._show(!0,!1,!0)),delete window.cur.storiesCashedBoxQueueData))}function p(){s.length>1&&(s[s.length-2].setLayerVisibility(!1),s[s.length-1].showBackButton())}function g(){s.length>1?s[s.length-2].setLayerVisibility(!0):(0,n.setStyle)("stories_layers_background","opacity",0)}function m(e){void 0===e&&(e=!1);for(var t=0;t<s.length;t++)s[t].hide(!0);if(window.layers.fullhide=!1,(0,n.removeClass)(document.body,"stories_layer_shown"),(0,n.re)("stories_layers_background"),(0,i.removeEvent)(window,"visibilitychange",c),(0,i.removeEvent)(window,"resize",d),(0,i.removeEvent)(document,"keydown",u),(0,i.removeEvent)(document,"keyup",h),e){var r=window.nav.objLoc;delete r.w,window.nav.setLoc(r)}window.cur.needUpdateFeedStories&&window.Stories.updateFeedStories(),s=[]}function f(){return s[0]}function w(){return s[s.length-2]}function y(){for(var e=s.length-2;e>=0;e--)s[e].doHide(!0);s.splice(0,s.length-1)}function E(e){for(var t=0;t<s.length;t++)s[t].onReplyDeleted(e)}function S(){var e;if(!(null===(e=window._message_boxes)||void 0===e?void 0:e.length))return null;var t=window._message_boxes.filter(Boolean);return t.length?t[t.length-1]:null}function C(e){(0,a.curBox)()&&(e.fromEl=null,function(){var e=S();e&&(e._hide(!1,!0,!0),e.forceHide=!0)}(),window.cur.storiesCashedBoxQueueData=(0,a.getAndCleanBoxQueueData)())}function N(){return l}window.LayersX=s},533228:(e,t,r)=>{"use strict";r.d(t,{getVolume:()=>s,setVolume:()=>l,getStoryList:()=>c,removeStoryList:()=>d,preloadDiscoverList:()=>u,fetchDiscover:()=>h,isDiscoverLoading:()=>v,getStoryBlockKey:()=>_,createUserStackMaskIfNeeded:()=>p,isReactionsEnabled:()=>g});var o=r(570655),i=r(341319),n=r(315544),a=r(19331);function s(){var e=window.ls.get("video_volume");return"number"==typeof e?Math.min(1,Math.max(0,e)):1}function l(e){window.ls.set("video_volume",e)}function c(e){return window.cur["stories_list_"+e]}function d(e){delete window.cur["stories_list_"+e]}function u(e){if(void 0===e&&(e=!1),window.cur.storiesDiscoverFetchingPromise)return window.cur.storiesDiscoverFetchingPromise;var t,r,n=c(i.StoryListName.feed);return n&&(r=n.find((function(e){return e.type===i.StoryBlockType.discover})))&&(t=r.track_code),window.cur.storiesDiscoverFetchingPromise=h("",t,e).then((function(e){var t=(0,o.__read)(e,2),i=t[0],n=t[1];return r&&(r.grouped=i,r.next_from=n),i})).finally((function(){delete window.cur.storiesDiscoverFetchingPromise})),window.cur.storiesDiscoverFetchingPromise}function h(e,t,r,o){return void 0===e&&(e=""),void 0===t&&(t=""),void 0===r&&(r=!1),void 0===o&&(o=15),new Promise((function(i,n){window.ajax.post("al_stories.php",{act:"get_discover",start_from:e,count:o,track_code:t},{loader:r,onDone:function(e,t){i([e,t])},onFail:function(e){return n(e),!0}})}))}function v(){return Boolean(window.cur.storiesDiscoverFetchingPromise)}function _(e){var t,r,o;return(null===(t=null==e?void 0:e.author)||void 0===t?void 0:t.id)&&(null===(r=null==e?void 0:e.narrative)||void 0===r?void 0:r.id)?e.author.id+"narrative"+(null===(o=e.narrative)||void 0===o?void 0:o.id):""+e.id}function p(){var e,t="users_stack_stories_mask",r=document.getElementById(t);r||(r=(0,n.se)('\n        <svg width="0" height="0">\n          <defs>\n            <clipPath id="'+t+'">\n              <path transform="translate(1.5 0)" d="M1.20772 8C1.20772 6.32671 0.768742 4.75626 0 3.39821C1.44342 1.34278 3.8277 0 6.52463 0C10.9293 0 14.5 3.58172 14.5 8C14.5 12.4183 10.9293 16 6.52463 16C3.8277 16 1.44342 14.6572 0 12.6018C0.768742 11.2437 1.20772 9.6733 1.20772 8Z"></path>\n            </clipPath>\n          </defs>  \n        </svg>  \n      '))&&(document.body.appendChild(r),null===(e=window.cur.destroy)||void 0===e||e.push((function(){null==r||r.remove()})))}function g(){return(0,a.partConfigEnabled)("story_reactions_sending_feature_web")}},453580:(e,t,r)=>{"use strict";r.d(t,{WallDataEvents:()=>a,registerUniqueListener:()=>c,registerNonGlobalNonUniqueListener:()=>d,emitEvent:()=>u});var o=r(570655),i=r(761508),n=r(469687),a={post_reactions_counts_update:"wall/post_reactions_counts_update",reply_reactions_counts_update:"wall/reply_reactions_counts_update"},s=(0,n.makeSharedState)("wall-data",(function(){return{emitter:new i.default,keyedListeners:Object.create(null)}})),l=function(e,t,r){var i,n,a=s(),l=null===(n=null===(i=a.keyedListeners)||void 0===i?void 0:i[e])||void 0===n?void 0:n[t];return l&&a.emitter.removeListener(e,l),function(e,t,r){var i,n=s();return n.emitter.addListener(e,r),n.keyedListeners[e]=(0,o.__assign)((0,o.__assign)({},n.keyedListeners[e]),((i={})[t]=r,i)),function(){var o,i;n.emitter.removeListener(e,r),(null===(o=n.keyedListeners[e])||void 0===o?void 0:o[t])===r&&(null===(i=n.keyedListeners[e])||void 0===i||delete i[t])}}(e,t,r)},c=function(e,t,r){return l(t,e,r)},d=function(e,t){return function(e,t){var r=s();return r.emitter.addListener(e,t),function(){r.emitter.removeListener(e,t)}}(e,t)},u=function(e,t){s().emitter.emit(e,t)}},210277:(e,t,r)=>{"use strict";r.d(t,{updateAriaLabelCounter:()=>n});var o=r(786067),i=r(325698),n=function(e,t,r){if("number"==typeof t&&e instanceof HTMLElement&&e.classList.contains("PostBottomAction")){var n=function(e){var t=void 0;switch(e){case i.LikeButtonTypes.comment:t=(0,o.getLang)("likes_comments_N_aria_short","raw");break;case i.LikeButtonTypes.like:t=(0,o.getLang)("likes_likes_N_aria_short","raw");break;case i.LikeButtonTypes.share:t=(0,o.getLang)("likes_shares_N_aria_short","raw")}return t}(r);if(n){var a=(0,o.langNumeric)(t,n,!1);e.setAttribute("aria-label",a)}}}}}]);try{stManager.done("dist/5da5a425c72a70255198a89623a242ff.080d6ab65de09f7ff6bb.js")}catch(e){}